C# Tutorial - Insert Update Delete Search data from local database | FoxLearn

Поділитися
Вставка
  • Опубліковано 27 сер 2024
  • Material Design Telephone Diary/Phone Book Insert Update Delete View and Search data from local database in C# using material skin. The C# Basics beginner course is a free C# Tutorial Series that helps beginning programmers learn the basics of the C# Programming Language
    Website: foxlearn.com
    insert update delete c# sql server
    Insert Update Delete View and search data from database in C#.net
    Fully C# Save, Insert, Update, Delete, View, Search, Clear in Visual studio
    C# Insert Update Delete and View data from database in .net
    Insert update delete select in c#
    insert update delete data in database from datagridview
    Update and Insert data in database from datagridview
    Insert Update Delete and Search Data in local databases Using CSharp

КОМЕНТАРІ • 368

  • @albertlucero2590
    @albertlucero2590 7 років тому +5

    how to fix this error message
    cannot insert explicit value for identity column in table PhoneBooks when identity_insert is set to off

  • @LarGriff
    @LarGriff 7 років тому +7

    "Cannot insert explicit value for identity column in table 'PhoneBooks' when IDENTITY_INSERT is set to OFF"
    I see a lot of people having the same problem, but I still don't understand the solution. Please explain in detail how to fix this. Thank you!

    • @michaeleilers3438
      @michaeleilers3438 2 роки тому

      Solution that I found was updating the Identity Specification from FALSE to TRUE. The person does this at around the 6:39 mark. Dont know how I missed it.

  • @andresescorcia6587
    @andresescorcia6587 7 років тому +1

    I already checked the code, the mistake is that parameters you inserted on "string.format" are textboxes that shows the information, So you should use is the searching's textbox.

  • @abdulrahmanrefaei1023
    @abdulrahmanrefaei1023 7 років тому +1

    Nice work ! Would you please make more videos about local database print , how to add pictures thank you

  • @AAAAAAAAAAAAANDREW
    @AAAAAAAAAAAAANDREW 6 років тому +5

    It's almost great video, except few bugs. BUT i can't solve a problem with SAVING data. Also, I have allready solved problem with IDENTITY - just by putting string "appData.PhoneBooks.AcceptChanges();" after "phoneBooksBindingSource.EndEdit();"
    BUT data is saving only in the Grid and don't saving in DataBase. After app restart - there are no data that I "saved".
    HELP, please!

    • @nervolnervol349
      @nervolnervol349 4 роки тому

      docs.microsoft.com/ru-ru/visualstudio/data-tools/save-data-back-to-the-database?view=vs-2019

  • @straich0434
    @straich0434 5 років тому +1

    I do not know if anyone still watches this but what worked for me for the "IDENTITY_INSERT is set to OFF" error is to simply rebuild the table adapter. It is a very easy process, just google it.

    • @foxlearn
      @foxlearn  4 роки тому

      Thank you !

    • @knives5972
      @knives5972 3 роки тому

      hi. could you tell me how? I cannot find the answer in google.. sorry

  • @dschmitz71
    @dschmitz71 4 роки тому

    A great tutorial where I learned a lot.
    First I forgot the AutoIncrement settings on the tables and the data was not saved. But I fixed that.
    Now I always get the error "IDENTITY_INSERT is set to OFF".
    I would be glad about a help.

    • @dschmitz71
      @dschmitz71 4 роки тому

      Cannot insert sxplicit value for identity Column in Table … when IDENTITY_INSERT ist set to OFF

    • @foxlearn
      @foxlearn  4 роки тому

      That's great. Thank you !

    • @dschmitz71
      @dschmitz71 4 роки тому

      @@foxlearn : Can you help with the Problem: "Cannot insert explicit value for identity Column in Table … when IDENTITY_INSERT ist set to OFF" ? Can you please send me the Code t: dschmitz71@hotmail.com

  • @baddragonfire
    @baddragonfire 7 років тому +2

    followed the tutorial but keep getting the "cannot insert explicit value for identity column in table 'phonebooks' when IDENTITY_INSERT is set to OFF" any help?

    • @baddragonfire
      @baddragonfire 7 років тому

      For somereason after completly restarting visual stuidos everything started to work fine. Just incase someone needs help.

    • @AAAAAAAAAAAAANDREW
      @AAAAAAAAAAAAANDREW 6 років тому +2

      I have allready solved problem with IDENTITY - just by putting string "appData.PhoneBooks.AcceptChanges();" after "phoneBooksBindingSource.EndEdit();"
      BUT data is saving only in the Grid and don't saving in DataBase. After app restart - there are no data that I "saved".

  • @darvin1982
    @darvin1982 7 років тому

    Hallo Fox Learn,
    danke für deine super Videos, wirklich klasse wie du das alles zeigst.
    Einen kleinen Tipp hätte ich aber - wie wäre es zum Teilen deine Programme Github zu benutzen? Das wäre für dich und deinen Zuschauern wesentlich einfacher. Außerdem müsste Visual Studio 2015 auch eine Github... haben. Also denke ich. :)
    Gruß
    Tobi

    • @foxlearn
      @foxlearn  7 років тому

      Thank you for your suggestion. I'm trying to build my website, i'll upload all in my site

  • @BustaJunix
    @BustaJunix 4 роки тому

    Very informative and Great video. How to add a code for validating an existing record in database to avoid duplication of record. Thank you very much. Very new to the C# and learning by video.

    • @foxlearn
      @foxlearn  4 роки тому

      Thank you !

    • @BustaJunix
      @BustaJunix 4 роки тому

      @@foxlearn Welcome. Hoping soon for another informative tutorial

  • @Saulred700
    @Saulred700 7 років тому

    Hi, I would like to know how do I search multiple data, for example, If I have two entries by the name "Anna" and I would like to search for Anna,How do I Show both datas, because I am only able to show the first anna that the program searchs.

  • @d_range211
    @d_range211 3 роки тому

    Wish there was more narrative and explanation 😉

  • @shaisen8572
    @shaisen8572 6 років тому

    Thanks for the video. But what is the purpose of materialskin?

  • @dlaregalaipo5516
    @dlaregalaipo5516 7 років тому

    also is there a way to validate if the record already exist to avoid duplication or record... tnx in advance

  • @ahmedmuntasir2620
    @ahmedmuntasir2620 7 років тому

    Hey! Can you show how to add a image in the database. Like I want to add an image with the contact info.

  • @michaeleilers3438
    @michaeleilers3438 2 роки тому

    Your 'SEARCH' feature didnt work correctly. Also, you put in the CANCEL button but did nothing with it.

  • @waelbenhassine8768
    @waelbenhassine8768 7 років тому

    Hello, please i need your help if possible. I'm using one of your video for coding my app from datagrid using sql data base, and i want the same proprieties for one form i'm using as in this video but the code you used is adapted for a local database. How i can adapt it for sql please? i'll appreciate your help and thank you so much for sharing all this.

    • @foxlearn
      @foxlearn  7 років тому

      Hi, You can reference videos ua-cam.com/video/d4-DYhaGFvQ/v-deo.html , ua-cam.com/video/TRH7rm8ozD4/v-deo.html . Thank you

  • @vautek
    @vautek 4 роки тому +1

    As usual nice work Fox, one of the posts in the past had a fix for PhoneBooks' when IDENTITY_INSERT is set to OFF I eventually tried it, it worked for me, I am not sure if it has affected any other part of the project. I have added an example below.
    Ok just test and it looks like it is not saving to data bass.
    private void btnSave_Click(object sender, EventArgs e)
    {
    try
    {
    Edit(false);
    phoneBooksBindingSource.EndEdit();
    phoneBooksTableAdapter.Update(appData.PhoneBooks);
    dataGridView.Refresh();
    txtPhoneNumber.Focus();
    MessageBox.Show("Your data has been successfully saved.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
    }
    catch (Exception ex)
    {
    MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
    appData.MemberDetails.RejectChanges();
    }
    }
    Ok just test after posting and it looks like it is not saving to the data base.

    • @foxlearn
      @foxlearn  4 роки тому

      You should copy your database to another folder. Each time you rebuild your project all data in debug folder will be deleted.

    • @vautek
      @vautek 4 роки тому

      @@foxlearn I have not rebuilt since I finished, I am now trying to use and it will not save. I click NEW then add details and then click SAVE I can add many customers ID to list but as I exit the form and open it again the data is not there

  • @mavericksfo
    @mavericksfo 7 років тому

    i am having an issue when i trying to run the .exe of the published program. i get an sql error when running the program on another computer..

  • @andhikautama
    @andhikautama 7 років тому

    is it possible to do it in excel instead of access??

  • @Hmoobtwjcuabchanel
    @Hmoobtwjcuabchanel 7 років тому +4

    How to fix Cannot insert explicit value for identity column when set identity off

    • @taufiqrahman2363
      @taufiqrahman2363 7 років тому

      Do you have the code?

    • @foxlearn
      @foxlearn  7 років тому +3

      Hi, You should set identity on. Please try again

    • @yassineaissaoui4143
      @yassineaissaoui4143 7 років тому

      how to set identity on please?
      i have problem Cannot insert explicit value for identity

    • @TrqHsn
      @TrqHsn 7 років тому

      I also have that problem... What should i do to solve it?

    • @sambo7849
      @sambo7849 6 років тому

      You can set it yourself here 6:30

  • @NanayaGC
    @NanayaGC 7 років тому

    What do you use for a Data Time? I have problems with that. Thanks.

    • @foxlearn
      @foxlearn  7 років тому

      Hi, what error are you getting ?thanks

  • @acvvoi
    @acvvoi 7 років тому

    Awesome video, very informative and well done. And if I want to install the application in another pc, how can I do that? (it threw me an error)

    • @foxlearn
      @foxlearn  7 років тому +1

      OK. Thank you for your suggestion. I'll make the tutorial on this as soon as possible !

    • @acvvoi
      @acvvoi 7 років тому

      Fox Learn Thanks dude, you have a great channel, subscribed!

  • @kizaymjumadullayeva4548
    @kizaymjumadullayeva4548 6 років тому

    datagrid is not being refreshed...why? pls help me...I used same code and form

  • @andresescorcia6587
    @andresescorcia6587 7 років тому

    Please review your code, has you noticed that it didn't search the information you typed in.
    Can you please check again the code? Great Video thanks a lot!!!

  • @Sylvethrin
    @Sylvethrin 7 років тому

    Hello, when I use commands like phoneBooksTableAdapter.Update(appData.PhoneBooks) or Message.Show(....) I get errors. For example in the Message case I get " 'Message' does not contain a definition for 'Show' ". What is wrong??

    • @foxlearn
      @foxlearn  7 років тому

      Hi, You need create windows form project, check your reference to System.Windows.Form

  • @nabeelurrehaman8190
    @nabeelurrehaman8190 7 років тому

    oswm vedio ...but i have a errror would help me .? the error is
    Cannot insert explicit value for identity column in table 'PhoneBook' when IDENTITY_INSERT is set to OFF.......first time i am using this mathod,,,,

    • @lxgrey07
      @lxgrey07 7 років тому

      change your target frame work to ".NET Frame 4.5.1

  • @vikydogphotovideo3370
    @vikydogphotovideo3370 4 роки тому

    Sorry but don't save into to database, when I restart....

  • @sanjaysawant8033
    @sanjaysawant8033 5 років тому

    Search functionality not working properly it always shows the first row,can anyone help me for this

  • @elizgrats1414
    @elizgrats1414 5 років тому

    Hello,
    I need your help.
    after searching for the required string, my database does not come to its original position.
    How to fix it?
    thank you in advance .

    • @foxlearn
      @foxlearn  5 років тому

      Please try to set position to bindingsource. Thank you !

  • @draganjatic3460
    @draganjatic3460 7 років тому

    I keep getting same error message when trying to save datas "cannot insert explicit value for identity column in table 'phonebooks' when IDENTITY_INSERT is set to OFF". I really don't know what is the problem. I did exactly as it is in the video. I even tried switching from true to false and nothing really happens. Pls help!

    • @foxlearn
      @foxlearn  7 років тому

      Hi, You need to set identity for primary key and the table in your dataset should set auto number is true. please try again. Thanks

  • @SadSadDeadM
    @SadSadDeadM 7 років тому

    I'm getting lots of errors refering to Form1.Designer.cs (Designer window display those errors) and also I'm getting error about AppData that there is no type or namespace like AppData.
    Does anyone knows how to solve those problems?

  • @TumeloMotsoeneng
    @TumeloMotsoeneng 6 років тому

    HI guys, i managed to solve the Insert Identity issue. Please click on the "dbo.PhoneBooks" plane and under properties switch Identity Column to "Id"

  • @jerrolmontemayor3564
    @jerrolmontemayor3564 6 років тому

    hello can i ask what if i want add a delete button ? what is the source code :-) .newbie here

  • @kaddouraouachria5768
    @kaddouraouachria5768 6 років тому

    thank you 1000/1000

    • @foxlearn
      @foxlearn  6 років тому

      You're welcome !

  • @avi6961
    @avi6961 4 роки тому

    I have done the same steps as you have shown in the window but still, when I click new and fill the details, they are not shown in the DataGridview. Also, when I again press new there comes an error message "Column id cannot be null".

    • @foxlearn
      @foxlearn  4 роки тому

      Try to open your dataset, then set the id column to autonumber

    • @Ajaysharma-dt5tj
      @Ajaysharma-dt5tj 3 роки тому

      @@foxlearn Sir i have also the same problem error that occurs -->>Column id cannot be null. and i have also try to solve but i don't get options to set the id column to autonumber

  • @ranjkurdish
    @ranjkurdish 4 роки тому

    hello ,can help me after the end project how insert to other computer and working .??...thank you fox learn

    • @foxlearn
      @foxlearn  4 роки тому +1

      You only need change your connection string in the app.config file

    • @ranjkurdish
      @ranjkurdish 4 роки тому

      Your have any vidoes About this ??

  • @unlimitedcreativity4400
    @unlimitedcreativity4400 5 років тому

    Hi, foxlearn how can I check from a database for logining like it check if user exists and is it a right password so he could login

    • @foxlearn
      @foxlearn  5 років тому

      ua-cam.com/video/4ToxRR-zlKs/v-deo.html .You can view this video. thank you !

  • @RedRidersTerraTrips
    @RedRidersTerraTrips 7 років тому

    Is it possible you could go trough adding delete on this ?

    • @foxlearn
      @foxlearn  7 років тому

      What do you mean? Can you describe more details? Thank you

  • @lif0CLUB
    @lif0CLUB 8 років тому

    Thank u

  • @lxgrey07
    @lxgrey07 7 років тому

    what if, add open location?

  • @kevinhaniel2008
    @kevinhaniel2008 6 років тому

    My material toolbox doesn't appear

  • @oBaykan
    @oBaykan 7 років тому

    Hello guys i have an error when i can try to insert a data to database.
    Error message is cannot insert explicit value for identity column in table Identity_insert is set to off
    How can i fix it?
    Thanks for your help :)

    • @foxlearn
      @foxlearn  7 років тому

      Hi, You need to set id column is primary key and set identity. insert data you don't need add id column it's auto genereate. thanks

  • @user-yq5ci7yk5s
    @user-yq5ci7yk5s 7 років тому +1

    Столкнулся с проблемой. Сделал все как описано на одной машине (Windows 7 Visual Studio 2010) - все работает. Как только перенес на другую машину (Windows XP Visual Studio 2010) сразу выдало, что невозможно вставить явное значение для столбца идентификаторов, когда IDENTITY_INSERT в положении OFF. Как быть? Куда, что или где переключить чтобы все заработало вновь?

    • @foxlearn
      @foxlearn  7 років тому

      Hi, I you should set id is auto number, copy to another computer your database structure don't change. please check again. thank you so much !

  • @vautek
    @vautek 4 роки тому

    Hi Fox, I have tried most of the solutions from the comments in posts the closest I get is a solution for a post but it still won't save to database do you have any other ideas. once I close the form and restart the form data is gone. on this example, the only changes I am using is memberDetails instead of phoneBooks and adding appData.MemberDetails.AcceptChanges();
    private void btnSave_Click(object sender, EventArgs e)
    {
    try
    {
    Edit(false);
    memberDetailsBindingSource.EndEdit(); appData.MemberDetails.AcceptChanges(); //edited
    memberDetailsTableAdapter.Update(appData.MemberDetails);
    dataGridView.Refresh();
    txtPhoneNumber.Focus();
    MessageBox.Show("Your data has been successfully saved.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
    }
    catch (Exception ex)
    {
    MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
    appData.MemberDetails.RejectChanges();
    }
    }
    Андрей И.
    1 year ago (edited)
    It's almost great video, except few bugs. BUT i can't solve a problem with SAVING data. Also, I have allready solved problem with IDENTITY - just by putting string "appData.PhoneBooks.AcceptChanges();" after "phoneBooksBindingSource.EndEdit();"
    BUT data is saving only in the Grid and don't saving in DataBase. After app restart - there are no data that I "saved".
    HELP, please!

    • @foxlearn
      @foxlearn  4 роки тому

      You should copy your database to another folder, by default your database copy to debug folder. Each time you rebuild your project all files in debug folder will be deleted.

  • @barunshah3464
    @barunshah3464 7 років тому

    +Fox Learn is C# and Windows C# programming same you do windows

    • @foxlearn
      @foxlearn  7 років тому

      Hi, C# is a programming language. With desktop application you can use C# Windows Forms. Thanks

    • @barunshah3464
      @barunshah3464 7 років тому

      No i know that but codes are same

    • @barunshah3464
      @barunshah3464 7 років тому

      i know that but the codes are same of c# windows programming and c# simple programming or not i am asking

  • @faiqwu9719
    @faiqwu9719 7 років тому

    I have follow step by step but cant save any data in my program/database pls anyone help me

  • @johnleonhelang5220
    @johnleonhelang5220 7 років тому

    How can i fix "Cannot insert explicit value for identity column when set identity off" Please help

    • @foxlearn
      @foxlearn  7 років тому

      Hi, I think you need to set identity is true, please check your id column again, Thank you

  • @geoffjollygeoff379
    @geoffjollygeoff379 7 років тому

    hi i want to add the data inside gridview like items and subitem can you please send the code

    • @foxlearn
      @foxlearn  7 років тому

      OK. Thank you for your suggestion. I'll make soon

  • @marto3224
    @marto3224 Рік тому

    The cancel button is unused, and the search is not working correctly in your video. Bad tutorial, in my opinion.

  • @syedjamalrizvi3464
    @syedjamalrizvi3464 8 років тому

    Please help me. when i click 'NEW' old record is not cleared

    • @foxlearn
      @foxlearn  8 років тому

      Hi, You need to add new object to bindingsource, please check your code again. thanks

  • @marianoamor9826
    @marianoamor9826 7 років тому

    If you observe the code you will see that when looking for some data you do not get what you are really looking for, but the first row of the datagrid. How can you fix that part of the code? , can you send me the code, thk

    • @foxlearn
      @foxlearn  7 років тому

      What's your email? thank you

    • @marianoamor9826
      @marianoamor9826 7 років тому

      amor-mariano@hotmail.com

    • @booney3133
      @booney3133 6 років тому

      I found a way with Button Click
      private void btn_Search_Click(object sender, EventArgs e)
      {
      string searchValue = txt_Search.Text;
      dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
      phoneBooksBindingSource.Filter = string.Format("{0} = '{1}'", "FullName", searchValue);
      //here you can do selection if you need
      }
      }
      }

  • @vwv5555
    @vwv5555 7 років тому

    could you please mention more cool themes. thanks!

    • @foxlearn
      @foxlearn  7 років тому

      Hi, You can use Metro Framework. Thanks

    • @vwv5555
      @vwv5555 7 років тому

      I know it and have used it, I mean if there are more themes... Thanks!!

  • @gustavoxumbin6787
    @gustavoxumbin6787 7 років тому +1

    My search does not work, i did equals the video, has somebody with this problemas?

    • @GreenSSB
      @GreenSSB 7 років тому

      Same, can't get it to work. Looking right now, let me know if you find something.

    • @booney3133
      @booney3133 6 років тому +3

      I found a way with Button Click
      private void btn_Search_Click(object sender, EventArgs e)
      {
      string searchValue = txt_Search.Text;
      dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
      phoneBooksBindingSource.Filter = string.Format("{0} = '{1}'", "FullName", searchValue);
      //here you can do selection if you need
      }
      }
      }

    • @muhammadzeyada2052
      @muhammadzeyada2052 6 років тому

      Thank you very much, I was struggling, you saved my life!

    • @muhammadzeyada2052
      @muhammadzeyada2052 6 років тому

      but how to get back the whole list again?

  • @buffaloSoldier519
    @buffaloSoldier519 8 років тому

    Won't let me add a reference to the material's toolbox

    • @foxlearn
      @foxlearn  8 років тому

      Hi, You can view this video: ua-cam.com/video/QdMXWyvKamE/v-deo.html, thanks

  • @jeroenmulder1400
    @jeroenmulder1400 7 років тому

    i cant get the material single line text box how can i fix this

    • @foxlearn
      @foxlearn  7 років тому

      Hi, You can view this video ua-cam.com/video/QdMXWyvKamE/v-deo.html to know to to install and add material skin to your toolbox, then you can find single line text box in your toolbox. . Thank you

  • @kzhanserik
    @kzhanserik 7 років тому

    how to add material skin controls to toolbox?

    • @foxlearn
      @foxlearn  7 років тому

      Hi, You can view this video ua-cam.com/video/QdMXWyvKamE/v-deo.html to know how to install and add material skin to your toolbox. Thank you

  • @ibrahemo10
    @ibrahemo10 8 років тому

    i got an error says "the type name AppData Does Not exist in the type name "my project name" "
    please help

    • @ibrahemo10
      @ibrahemo10 8 років тому

      problem solved by changing the class name into another

    • @foxlearn
      @foxlearn  8 років тому +1

      That's great, the AppData is name of the DataSet, you can put any name :)

  • @faiqwu9719
    @faiqwu9719 7 років тому

    Hi this really helpful video but i always fault when tryin to save data in mu database, when i ran my program and click new it always said phonenumber cannot null and the main problem is when i have to fill all the txt and click save the database is not inserted it only show the message box "data has been successfully saved!" Please someone help me, im a newbie and really need it :(

    • @faiqwu9719
      @faiqwu9719 7 років тому

      +Dewi Cunny so sad to hear this happened to you, anyway i still stuck in this problem, but if you cant show the messagebox it really wierd, have you type --> MessageBox.Show("your Message","Message",MessageBoxbutton.OK,MessageBoxIcon.Information); ? If you write that line and still have error maybe the problem is with your visual studio

    • @faiqwu9719
      @faiqwu9719 7 років тому

      happy that you solved it, for search funciton i think the tutorial was doing right just follow this video and makesure you dont miss anything (ya sometimes is not well explained). anyway what you do to input and save your data into the database? i still stuck with this problem for a couple of months

    • @faiqwu9719
      @faiqwu9719 7 років тому

      that mean you make new savebutton_click method and solved your problem? where you got that code?
      thank you you are so kind :)

    • @faiqwu9719
      @faiqwu9719 7 років тому

      i don't know what should i do coz i also create new and follow it again again and again but the problem is the same

    • @TheGopirock
      @TheGopirock 7 років тому

      were u able to get your data after clicking 'Save'? my data is not showing..but it says that data has been inserted successfully.

  • @hasanal-samarae7847
    @hasanal-samarae7847 7 років тому

    why arabic characters become question marks
    in the dataGridView

    • @foxlearn
      @foxlearn  7 років тому

      Hi, I think you should save data with nvarchar instead of varchar, Please check your datatype again. Thank you

    • @hasanal-samarae7847
      @hasanal-samarae7847 7 років тому

      thanks, it worked.

  • @geoffjollygeoff379
    @geoffjollygeoff379 7 років тому

    hi I want print option with adding logo can you please send me a source code

    • @foxlearn
      @foxlearn  7 років тому

      Hi, What's your email? thank you

  • @ibrahemo10
    @ibrahemo10 8 років тому +1

    i got another error when saving the data says "cannot insert explicit value for identity column in table 'phonebooks' when IDENTITY_INSERT is set to OFF "

    • @foxlearn
      @foxlearn  8 років тому +2

      Hi, You need to set the identity column is auto number both table in dataset, and table in your database, please try again. thanks

    • @ibrahemo10
      @ibrahemo10 8 років тому +2

      +Fox Learn ok i'll give it a shot, it works by setting the identity column to false but i need it to be auto so i'll try.
      Thanks alot

    • @syedjamalrizvi3464
      @syedjamalrizvi3464 8 років тому +4

      I am also getting this error. Help me how i resolve it.

    • @ibrahemo10
      @ibrahemo10 8 років тому

      Jamal Rizvi Hi, you can resolve this problem by setting the id column identity from true to false

    • @syedjamalrizvi3464
      @syedjamalrizvi3464 8 років тому

      Thanks dear. Now record has been saved successfully. But when i click 'NEW' old record is not cleared

  • @JokerZipon
    @JokerZipon 8 років тому

    Почему сразу не сохраняет т.е. вышел из формы и информация пропала

    • @foxlearn
      @foxlearn  8 років тому

      What information are you missing?

    • @JokerZipon
      @JokerZipon 8 років тому

      Запуск из Visual Studio, а не на прямую .exe При каждой компиляции сборки, данные исчезают, с чем связано ?

  • @valery_osanin
    @valery_osanin 7 років тому

    How to use for search the button?

    • @foxlearn
      @foxlearn  7 років тому

      Hi, You can add a button search, then copy code even key press to button click, thanks

    • @booney3133
      @booney3133 6 років тому

      I found a way with Button Click
      private void btn_Search_Click(object sender, EventArgs e)
      {
      string searchValue = txt_Search.Text;
      dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
      phoneBooksBindingSource.Filter = string.Format("{0} = '{1}'", "FullName", searchValue);
      //here you can do selection if you need
      }
      }
      }

  • @MauricioCaterino
    @MauricioCaterino 7 років тому

    Can you send me the code

  • @SATHISHKUMARVMIS
    @SATHISHKUMARVMIS 6 років тому

    can anyone send me this code
    ?

  • @taufiqrahman2363
    @taufiqrahman2363 7 років тому

    Can you kindly send me the code?
    I'm stuck at one part.

    • @foxlearn
      @foxlearn  7 років тому

      Hi, What's your email? thanks

    • @taufiqrahman2363
      @taufiqrahman2363 7 років тому

      taufiqrx8@gmail.com
      thanks in advance! :)

    • @taufiqrahman2363
      @taufiqrahman2363 7 років тому

      +Fox Learn

    • @foxlearn
      @foxlearn  7 років тому +1

      Sent. Thanks

    • @SalmanAli-yk5mx
      @SalmanAli-yk5mx 7 років тому

      Can you please send me the code at alisalman668@gmail.com. Its urgent. I will be thankful to you bro

  • @Rey_MR
    @Rey_MR 6 років тому

    y el maldito codigo he ? esa mierda me da error

  • @houriahoumel8679
    @houriahoumel8679 7 років тому

    could you send me source code for this project

  • @bahaashaban2609
    @bahaashaban2609 6 років тому

    send me the code

  • @dimaarabul8191
    @dimaarabul8191 6 років тому

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using MaterialSkin;
    namespace Forma
    {
    public partial class Form1 : MaterialSkin.Controls.MaterialForm
    {
    public Form1()
    {
    InitializeComponent();
    var skinManager = MaterialSkinManager.Instance;
    skinManager.AddFormToManage(this);
    skinManager.Theme = MaterialSkinManager.Themes.DARK;
    skinManager.ColorScheme = new ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500,Accent.LightBlue200,TextShade.WHITE);
    }
    private void Form1_Load(object sender, EventArgs e)
    {
    // TODO: данная строка кода позволяет загрузить данные в таблицу "appData.Sport". При необходимости она может быть перемещена или удалена.
    this.sportTableAdapter.Fill(this.appData.Sport);
    Edit(false);
    }
    private void Edit(bool value)
    {
    txtPhoneNumber.Enabled = value;
    txtFullName.Enabled = value;
    txtEmail.Enabled = value;
    txtAdress.Enabled = value;
    }
    private void btnNew_Click(object sender, EventArgs e)
    {
    try
    {
    Edit(true);
    appData.Sport.AddSportRow(appData.Sport.NewSportRow());
    sportBindingSource.MoveLast();
    txtPhoneNumber.Focus();
    }
    catch(Exception ex)
    {
    MessageBox.Show(ex.Message, "Оповещение", MessageBoxButtons.OK, MessageBoxIcon.Error);
    appData.Sport.RejectChanges();
    }
    }
    private void btnEdit_Click(object sender, EventArgs e)
    {
    Edit(true);
    txtPhoneNumber.Focus();
    }
    private void btnCancel_Click(object sender, EventArgs e)
    {
    Edit(false);
    sportBindingSource.ResetBindings(false);
    }
    private void btnSave_Click(object sender, EventArgs e)
    {
    try
    {
    Edit(false);
    sportBindingSource.EndEdit();
    sportTableAdapter.Update(appData.Sport);
    dataGridView.Refresh();
    txtPhoneNumber.Focus();
    MessageBox.Show("Cохранить запись запись?", "Оповещение", MessageBoxButtons.OK, MessageBoxIcon.Information);
    }
    catch (Exception ex)
    {
    MessageBox.Show(ex.Message, "Оповещение", MessageBoxButtons.OK, MessageBoxIcon.Error);
    appData.Sport.RejectChanges();
    }
    }
    private void txtSeach_KeyDown(object sender, KeyEventArgs e)
    {
    if (e.KeyCode == Keys.Enter)
    {
    if (!string.IsNullOrEmpty(txtSeach.Text))
    sportBindingSource.Filter = string.Format("PhoneNumber = '{0}' OR FullName LIKE '*{1}*' OR Email ='{2}' OR Adress LIKE '*{3}*'", txtPhoneNumber.Text,txtFullName.Text,txtEmail.Text,txtAdress.Text);
    else
    sportBindingSource.Filter = string.Empty;
    }
    }
    private void dataGridView_KeyDown(object sender, KeyEventArgs e)
    {
    if (e.KeyCode == Keys.Delete)
    {
    if (MessageBox.Show("Вы Уверена что хотите удалить запись ?", "Оповещение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) ;
    sportBindingSource.RemoveCurrent();
    }
    }
    }
    }

  • @anhesenatonanhesenator5219
    @anhesenatonanhesenator5219 6 років тому

    Здравствуйте, спасибо большое за видео! Но не могу разобраться как сделать поиск, а у вас там ошибочка ( можете пожалуйста прислать код на почту anksunamun-99@mail.ru

  • @kaifahmed1332
    @kaifahmed1332 7 років тому

    please sent me too :)

  • @FilthyLemon
    @FilthyLemon 7 років тому

    Not sure using an extremely fast, unclear AI voice was the best idea in a tutorial, and I think you could've explained what you were doing as opposed to having that AI voice giving a speedy background narration. Get's a dislike from me.

    • @foxlearn
      @foxlearn  7 років тому

      Thank you for your suggestion, I'll try to better :(

  • @mohammadaziz150
    @mohammadaziz150 7 років тому

    u very eng ,send me code
    plaes

    • @foxlearn
      @foxlearn  7 років тому

      Sent, Please check your email. Thank you

    • @mohammadaziz150
      @mohammadaziz150 7 років тому

      Fox Learn alabadan.market@gmail.com