Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
How to insert the data to sql table?
Dinesh Santhalingam
Jan 23 2017 12:32 AM
266
Reply
I have some values .I want to insert the values into the Sql table .Here is my code.There were no error populating.But i can't able to insert the data to sql table.
using (SqlConnection
Connection
=
new
SqlConnection((@"Data Source")))
{
using (SqlCommand
myCommand
=
new
SqlCommand("INSERT INTO table1(Nameofbike,Totalbike,
Inuse)", Connection))
{
Connection.Open();
myCommand.Parameters.Add(new SqlParameter("Nameofbike", "Hero"));
myCommand.Parameters.Add(new SqlParameter("Totalbike", "15"))
myCommand.Parameters.Add(new SqlParameter("Inuse", "10"));
}
Connection.Close();
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
HOW TO MAKE EACH TEXTBOX PERFORM SUMMATION
How to add Item to a list in c#?