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();
- }

Rajeesh MenothRank #118 · 18.4K reputationPosted Jan 22, 2017, 8:28 PM EST
Mangesh GRank #294 · 8.6K reputationPosted Jan 22, 2017, 8:19 PM EST
Mangesh GRank #294 · 8.6K reputationPosted Jan 22, 2017, 8:24 PM EST
Dinesh SanthalingamRank #2,085 · 690 reputationPosted Jan 22, 2017, 8:26 PM EST