I think In your quary has error once check your quary(candintrest)
ex:For Insert Quary
create procedure like
Create PROCEDURE dbo.StoredProcedure1(@id int,@name varchar(50),@addr varchar(50))
AS
begin
insert into sample (id,name,address) values(@id,@name,@addr)
end
in code behind:
con = New SqlConnection(ConfigurationManager.ConnectionStrings("con").ConnectionString)
cmd = New SqlCommand()
If con.State = ConnectionState.Closed Then
con.Open()
End If
cmd.Connection = con
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "StoredProcedure1"
cmd.Parameters.AddWithValue("@id", TextBox1.Text)
cmd.Parameters.AddWithValue("@name", TextBox2.Text)
cmd.Parameters.AddWithValue("@addr", TextBox3.Text)
Dim i As Integer
i = cmd.ExecuteNonQuery()
If (i >= 1) Then
Response.Write("sucess")
Else
Response.Write("Fail")
End If
con.Close()