C# MS Access Database Tutorial 6 # Insert/Save data to database

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 พ.ย. 2024

ความคิดเห็น • 121

  • @alanbecerra4245
    @alanbecerra4245 4 ปีที่แล้ว

    Hours spend learning and you explained in minutes. Ay caramba . Thanks

  • @Reaper_f30
    @Reaper_f30 9 ปีที่แล้ว

    these videos are so helpful man thanks... im at uni and the idiots gave us the programming module half way through semester one and its due 2 weeks from know. All the resources don't show us what we need to do. Also we haven't even had time to finish off all learning weeks so out of 8 we have only done 3 and been told to do project...Your a life saver man!

    • @dandogamer
      @dandogamer 8 ปีที่แล้ว

      +Sanjeev Dhillon I have a group coursework project to hand in 2 weeks from now and they have just said to use ASP.net and C# without teaching us anything. Lecturer just said "welcome to the real world" and handed us this massive project.

    • @dandogamer
      @dandogamer 8 ปีที่แล้ว

      Sanjeev Dhillon
      Yeah he is only doing it to us because thats what happened to him years ago. :P

  • @digimikeh
    @digimikeh 6 ปีที่แล้ว +1

    If you get confused using "," + textObject , etc... you previously create a string var using string.Format with the way:
    string preCmdText = String.Format(“insert into MyDB ([Name], [Age]) values ({0}, {1})”, tboxName.Text, tboxAge.Text);
    command.CommandText = preCmdText;

  • @robkriger9095
    @robkriger9095 6 ปีที่แล้ว +2

    Thank you very much for your videos! I like that they are simplistic and to the point, and that you do a great job of explaining why you are doing each step. You make it very easy to create good working programs and still be a newb. Thank you!

  • @pyrexo
    @pyrexo 9 ปีที่แล้ว +4

    For the insert into error, put "[ ]" between column names just as +Findle Fins has done!

    • @Max-wi5ho
      @Max-wi5ho 8 ปีที่แล้ว +2

      +pyrexo what do u mean i got this error

    • @rodrigoablin2048
      @rodrigoablin2048 5 ปีที่แล้ว +1

      Yes this solution worked.. thanks

    • @supersloth1667
      @supersloth1667 2 ปีที่แล้ว +2

      Thank you!

    • @Taitanic_tv
      @Taitanic_tv 2 ปีที่แล้ว

      Thanks a lot, worked for me

  • @ashishbhadani2608
    @ashishbhadani2608 5 ปีที่แล้ว +2

    I got errror into system.data.oledbexception : syntax error into statement

  • @mbs2488
    @mbs2488 7 ปีที่แล้ว +1

    Excellent teacher, I'm learning a lot !!

  • @AmahleBoyce
    @AmahleBoyce 6 หลายเดือนก่อน

    Can you use if statements to check if correct length values where inputted into the textboxes then display a message if not?

  • @thorramosjr6137
    @thorramosjr6137 10 ปีที่แล้ว +3

    Hi ProgrammingKnowledge , How can I add more some data to a database? I tried to add 2 more Textboxt such as Address and age but I cannot make it. It shows an error once I hit the "SAVE DATA" button. Can you help me fix it? Is there somebody can help me there?

  • @erocsorez3094
    @erocsorez3094 4 ปีที่แล้ว +1

    Thank you for this sir!, i understand you best than my professors T^T

  • @xarakkhan1727
    @xarakkhan1727 9 ปีที่แล้ว +13

    Error
    INSERT INTO SYNTAX ERROR

  • @BipulLamsal
    @BipulLamsal 5 ปีที่แล้ว

    You are a Guinness! from Nepal!

  • @Brenda8273
    @Brenda8273 9 ปีที่แล้ว

    I found this video to most helpful. I know have a better understanding for how Visual Studio works and inserting other data to it.

  • @vinaynaik21
    @vinaynaik21 10 ปีที่แล้ว

    Good Job you have taken so much effort.

  • @ProgrammingKnowledge
    @ProgrammingKnowledge  10 ปีที่แล้ว

    • @sharvinrethnakumar7671
      @sharvinrethnakumar7671 8 ปีที่แล้ว +1

      im getting error on the insert into, how to solve it? please help

    • @BRodTutorials
      @BRodTutorials 7 ปีที่แล้ว +1

      All you have to do is put brackets around ([FirstName], [Lastname], [Pay]) so you get--->
      command.CommandText = "insert into EmployeeData ([FirstName], [LastName], [Pay]) values('" + txt_fname.Text + "','" + txt_lname.Text + ",'"+txt_pay.Text+"')";
      If this helped please subscribe to my channel :) I will be coming out with a huge C# tutorial series with simplicity and clarity. Thank you!

    • @astrophel12
      @astrophel12 6 ปีที่แล้ว

      got an error on command.ExecuteNonquery();

    • @ivanputric6232
      @ivanputric6232 5 ปีที่แล้ว

      command.Connection = connection; that was line that i missed after OleDbCommand command = new OleDbCommand();

  • @bliitzeg
    @bliitzeg 10 ปีที่แล้ว

    I learned so much with you videos :) , thanks for upload video like this.

  • @anmolsingh5562
    @anmolsingh5562 8 ปีที่แล้ว +1

    Thanks a lot, worked for me.

  • @abuodai5938
    @abuodai5938 7 ปีที่แล้ว +1

    Hello, i tried to insert into an exclusively locked access database. And i always getting an error
    Is there any special command-text for the exclusively locked access database?

  • @salvinorandazzo
    @salvinorandazzo 6 ปีที่แล้ว +1

    Like many other users I got a SQL syntax error using the SQL syntax as shown ( "insert into EmployeeData(Firstname,Lastname,Pay]) values('" + txt_fname.Text + "','" + txt_pword.Text + "','" + txt_pay.Text + "')";).
    Then I found Findle Fins's comment, and added square brackets, and now it works!
    But why?
    StakOverflow says that VisuaStudio needs square brackets
    stackoverflow.com/questions/52898/what-is-the-use-of-the-square-brackets-in-sql-statements
    and indeed it works.
    I still can't understand why the orignal version without brackets. Maybe he was using an older VisuaStudio version with a different behaviour.

  • @Zeroamiel
    @Zeroamiel 9 ปีที่แล้ว +2

    Thank you so much, you did a great job :)

  • @theaigirl6875
    @theaigirl6875 7 ปีที่แล้ว +1

    You saved me Man !! Thank you so much :D

  • @djlurano
    @djlurano 10 ปีที่แล้ว

    it's working perfect,but how can i set that i can display a messagebox when i try to add a person who is already added so i won't get persons double? thank you very much!

  • @stanleyoverby4179
    @stanleyoverby4179 8 ปีที่แล้ว

    In my case i have a ton of text boxes & combo boxes that i need to do this on multiple lines which creates a problem when you are using concatenation.

  • @BankaiCorp
    @BankaiCorp 9 ปีที่แล้ว

    Thx for the tutorial :)
    But I got a Problem: How can i show a checked Checkbox into the MS Access database?
    All the textboxes, Dates and even combobox values can be saved.... but not the checked state of a Checkbox.
    Any suggests?

  • @jamalkg
    @jamalkg 9 ปีที่แล้ว

    excellent tutorial that helped me alot, thanks.

  • @SoulDevil92
    @SoulDevil92 7 ปีที่แล้ว

    What if do you have multiple tables? I need to manage more than 1 Access table, how can I switch between them? Do I need a different form for every table, right?

  • @heenatilvani8676
    @heenatilvani8676 3 ปีที่แล้ว

    Sir i give primary key in id Feild it's error occurs :values are not match what to do please help me

  • @hikariamari3148
    @hikariamari3148 7 ปีที่แล้ว +2

    data saved but not record into database..
    how to fix that?

  • @Zzzzn07
    @Zzzzn07 10 ปีที่แล้ว

    what if the textbox is empty?? in the register form to insert database? i need a code for the error message on it when the field is empty. PLEASE HELP :(

  • @YakshaKatha
    @YakshaKatha 9 ปีที่แล้ว

    I have one question.
    Database connection is closed in try block. What if some exception occurs in try block?
    The connection would never close.

  • @vinaynaik21
    @vinaynaik21 10 ปีที่แล้ว

    Helped a lot thank you so much...

  • @ju9253
    @ju9253 9 ปีที่แล้ว

    help why it says not registered on local machine ? . im using visual studio 2013 and access 2013

  • @harendra9834
    @harendra9834 4 ปีที่แล้ว

    Hi,
    How to search records between two dates using ms access database in c#?

  • @zoyi811
    @zoyi811 10 ปีที่แล้ว

    Hello,
    The tutorial is very good! What i have to change if i want to fill up a text box with date like birthdate? Can you make a tutorial video about it? Thx!

  • @zaidoonjabbar8024
    @zaidoonjabbar8024 3 ปีที่แล้ว

    how can i solve multy user opning the accessdatabase?

  • @adamholt8265
    @adamholt8265 10 ปีที่แล้ว

    Im getting an error with the INSERT INTO statement - please could you help!

  • @sayatbazarkanov5960
    @sayatbazarkanov5960 8 ปีที่แล้ว +1

    Thank you, very good tutorial, but it will be better if you write a link to code, too lazy to write a code ))

  • @luonghai92
    @luonghai92 9 ปีที่แล้ว

    can you tell me how to insert a new record as the last row. I dont why it dont follow any rules?

  • @KhalidAfridi1
    @KhalidAfridi1 6 ปีที่แล้ว

    Why you keep open Access Table in Design mode while retrieving data???? Its not true that access not allowed multiple connection to be opened. .....

  • @abdouroihamanemmadi422
    @abdouroihamanemmadi422 8 ปีที่แล้ว

    Can you make one video for how to save data with image?

  • @stanleyoverby4179
    @stanleyoverby4179 8 ปีที่แล้ว

    I've lost the connection is successful label. I ended renaming the form after i did that so maybe that might be the problem but i don't know how to get it back

  • @marielsalem9053
    @marielsalem9053 9 ปีที่แล้ว +5

    it doesn't insert in my database, when I click "save" nothing happens

    • @Justin-BroskiMode
      @Justin-BroskiMode 8 ปีที่แล้ว

      +Mariel Salem same

    • @srcyber1250
      @srcyber1250 4 ปีที่แล้ว

      @@Justin-BroskiMode did find the solution?

    • @srcyber1250
      @srcyber1250 4 ปีที่แล้ว

      did you find the solution?

  • @زينه-س8ز
    @زينه-س8ز 4 ปีที่แล้ว

    Thank you soooo much 💗💗💗💗

  • @vishakhasinha243
    @vishakhasinha243 7 ปีที่แล้ว

    Can you help with the code for inserting date???

  • @theepankonesh
    @theepankonesh 8 ปีที่แล้ว

    I have figured out error but now I had problems in saving data it's saving data over and over again if I click save button how can I able to fixed that plz help me thx

  • @MrRyan9554
    @MrRyan9554 10 ปีที่แล้ว

    Why after i save data but my access database wont update the data i save? pls help...

  • @Amine96ification
    @Amine96ification 7 ปีที่แล้ว +1

    It shows me that Data is already saved but nothing is really added in my Access db table ! Help me please

    • @prakashxavier
      @prakashxavier 2 ปีที่แล้ว

      I hve the same issue. Whats wrong?

  • @mariyashaikh5280
    @mariyashaikh5280 5 ปีที่แล้ว

    what we have to do for data already save message

  • @alibarznji2000
    @alibarznji2000 5 ปีที่แล้ว

    the insert button works but the data is not saved in my database

  • @58no85
    @58no85 9 ปีที่แล้ว

    enjoyable and useful

  • @morpheus7550
    @morpheus7550 7 ปีที่แล้ว +1

    syntax error, insert into statement
    how do you fix that?

    • @sivk4501
      @sivk4501 7 ปีที่แล้ว

      you forgot word INTO between insert and table name

    • @ForerunnerAlpha
      @ForerunnerAlpha 4 ปีที่แล้ว

      @@sivk4501 No, it means there's an error in the "input Into" statement.

  • @kalyanimandilkar7487
    @kalyanimandilkar7487 5 ปีที่แล้ว +1

    error insert into syntax error

  • @jiromesbaril9419
    @jiromesbaril9419 8 ปีที่แล้ว

    I successfully save the data in my ms access but when i insert another data i get an exception says that they would create duplicate values in the index, primary key, or relation. when i check my database the primary key of the first data that i inserted is 0. I think that when you add another data, the primary key will not increment. how to fix?

    • @astrophel12
      @astrophel12 6 ปีที่แล้ว

      in access database
      go to design view > change your primary key's data type into auto increment > save your database > run your program.
      oh im 1 year late^^ eheheh

  • @nehatuteja
    @nehatuteja 9 ปีที่แล้ว

    my data does not affected the access file

  • @NajmuddinDohadwala
    @NajmuddinDohadwala 6 ปีที่แล้ว

    ErrorSystem.Data.oleDb.oleDbException(0x80040E14):Syntax error in INSERT INTO statement.(Error show to save button click please sent me some other code

  • @katecolleenverzonilla906
    @katecolleenverzonilla906 9 ปีที่แล้ว

    i get the error "Could not find installable ISAM."

  • @Ar3Schannels
    @Ar3Schannels 8 ปีที่แล้ว

    sorry which is the connection string for access 2016?

    • @PutraWahyuSejati
      @PutraWahyuSejati 8 ปีที่แล้ว

      +FreeZy i have the same problem! did u figure it out?

    • @perryhoofd
      @perryhoofd 8 ปีที่แล้ว

      +Putra Wahyu S @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + database + ";Persist Security Info=False;"; If this gives an error, try to install www.microsoft.com/en-us/download/confirmation.aspx?id=23734. If this does not work either, install the 2010 version (just google it)

  • @pratishthasahai636
    @pratishthasahai636 5 ปีที่แล้ว

    Thankyou

  • @bhavsarsuraj4325
    @bhavsarsuraj4325 7 ปีที่แล้ว

    How to get date from datepicker

  • @NajmuddinDohadwala
    @NajmuddinDohadwala 6 ปีที่แล้ว

    Hello my Login and Password form its work but i have create 2nd form in connect to employee table but he not save any data please check your code b/c i have right your code

    • @deansmith1506
      @deansmith1506 6 ปีที่แล้ว

      Other than his out dated connection string his code is correct, check that there are no spaces in your table names or column names. The error is somewhere is your code

  • @Justin-BroskiMode
    @Justin-BroskiMode 8 ปีที่แล้ว +4

    Did exactly what you did and it's not putting the data in the database.

    • @gefalt
      @gefalt 8 ปีที่แล้ว

      same it's showing the error whenever I click the save button.

    • @Peppzwerg
      @Peppzwerg 7 ปีที่แล้ว +2

      You need to write the Names in Square Brackets, like this:
      EmployeeData([Firstname],[Lastname],[Pay])

    • @muhammadusamazuberi5188
      @muhammadusamazuberi5188 6 ปีที่แล้ว

      check if the connection string is correct!
      Or table and its field names are correctly written in query.
      And also check if the connections are opened and closed correctly given right sequence.

  • @tomislavfedek6678
    @tomislavfedek6678 10 ปีที่แล้ว +1

    dont work for me

  • @sohanagate3037
    @sohanagate3037 9 ปีที่แล้ว

    Thanks a lot !!!!!!!!!!

  • @mimitk6642
    @mimitk6642 6 ปีที่แล้ว

    helppppp ?!!!
    my Data is not inserted(saved) in MS access database but it is shown in datagrid ?!! why tho ?!
    thanks dude ,I appreciate your work !!

  • @อิอินะสัดล้อเล่นอิอิ

    Hi,Im getting an error with the INSERT INTO statement
    How I can Fix ?? ///Thank

    • @adamsgier9049
      @adamsgier9049 5 ปีที่แล้ว +1

      Did you solve it?

    • @christiangamayot1345
      @christiangamayot1345 4 ปีที่แล้ว

      @@adamsgier9049 same problem here how did u fix it?

    • @adamsgier9049
      @adamsgier9049 4 ปีที่แล้ว

      @@christiangamayot1345 I didn't 😂😅

    • @christiangamayot1345
      @christiangamayot1345 4 ปีที่แล้ว +1

      @@adamsgier9049 i've fixed it, you should put brackets [] outside the fieldname like this [fieldname] hahaha

    • @adamsgier9049
      @adamsgier9049 4 ปีที่แล้ว

      Oooooooohhhhhhh!!!!!!😂😂😂😂

  • @nordxdelis2672
    @nordxdelis2672 10 ปีที่แล้ว

    same error as Naveen MEnon. Error in insert syntax.

    • @adamholt8265
      @adamholt8265 10 ปีที่แล้ว

      Me too - did you find a fix?

  • @SurajKumar-lb1ii
    @SurajKumar-lb1ii 8 ปีที่แล้ว

    it cannot save the data

  • @astrophel12
    @astrophel12 6 ปีที่แล้ว

    got an error at connection.Open();

  • @songnguyendoan3390
    @songnguyendoan3390 2 ปีที่แล้ว

    Error line 30 🙄🙄

  • @irashanmaduranga8953
    @irashanmaduranga8953 8 ปีที่แล้ว

    tnz this one is very use ful for me tnank you soooo much