Part 1 of 5: Adding data to SQL Server with C# and ADO.Net
Uploader Comments (BablioBr)
All Comments (140)
-
@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 = "";
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=myPassword;" I hope this helps.. good luck.
BablioBr 9 months ago
Hi, just finished your 1-5 tutorial but got an error in this video. I get an error when it reaches "da.InsertCommand.ExecuteNonQuery();" 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 1 year ago
@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.
BablioBr 1 year ago
@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.
BablioBr 1 year ago