Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Part 1 of 5: Adding data to SQL Server with C# and ADO.Net

Loading...

Sign in or sign up now!
64,870
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Sep 5, 2009

Quick video describing a simple way to save data to SQL using the sqlDataAdapter object by Fabio Scopel

Category:

Education

Tags:

License:

Standard YouTube License

Link to this comment:

Share to:

Uploader Comments (BablioBr)

  • Couple of things: First .. "...Data Source=.\\SQLEXPRESS;..." 2 backslashes? Try ".\SQLEXPRESS" instead of ".\\SQLEXPRESS" Second: "; Integrated Security=TRUE");" means that Windows Authorization is enabled.. perhaps you need to enter the SQl user name and password... Try using this instead of "Integrated Security=TRUE": ";User Id=myUsername;Password=myPassw­ord;" I hope this helps.. good luck.

  • Hi, just finished your 1-5 tutorial but got an error in this video. I get an error when it reaches "da.InsertCommand.ExecuteNonQu­ery();" it says

    "Column name or number of supplied values does not match table definition."

    Tried everything but to no avail. the lesson 2 to 5 were done except for this.

  • @karlinoDS Without looking at you code, my best guess is that your ID column is the problem. "Column name or number of supplied values does not match table definition. "Column name" - make sure your INSERT sql has the right syntax.. correct spelling of the column names. "Number of supplied values does not match table definition" - make sure you are passing all value to all column.

  • @karlinoDS In regards to the ID column in SQL make sure it has this specifications: Identity Specification: Yes; (is Identity): Yes; Identity Increment :1; Identity Seed: 1; I hope this will help.

see all

All Comments (140)

Sign In or Sign Up now to post a comment!
  • @BablioBr my IDE would just tell me \ is an unrecognized escape sequence :(

  • good lesson! ; )

  • Great Friend I just wanted to know That..Thanks a A lot Bro.. Send me your email..

  • Great Videos!!! I made my whole project just by watching your Videos!! Bundles of Thanks!! Keep up the great work!!!

  • man, you rule....great knowledge :) thanks, your videos helped me a looooot ...

  • @BablioBr What if i have a table Student and want a field that displays student picture in a pictureBox (and also be able to browse image files and change it), StudentID could be foreign key of ImageDB table (assuming we have Student and ImageDB tables separate) and somehow find a way so that when selecting a specific row from datagrid pictureBox gets updated with image linked to that StudentID

  • The messageBox comes up but i cannot continue inserting, the code i originally have is

    void insert() { String FirstName = "";

View all Comments »
Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more