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