Hi indradeo,
Refer below article.
Pass (Send) value from one Page to another using QueryString in ASP.Net with C# and VB.Net
For insert use below code.
Code
C#
string name = Request.QueryString["name"];
string technology = Request.QueryString["technology"];
string query = "INSERT INTO Details VALUES(@Name,@Technology)";
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand(query))
{
cmd.Parameters.AddWithValue("@Name", name);
cmd.Parameters.AddWithValue("@Technology", technology);
cmd.Connection = con;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
}
VB.Net
Dim name As String = Request.QueryString("name")
Dim technology As String = Request.QueryString("technology")
Dim query As String = "INSERT INTO Details VALUES(@Name,@Technology)"
Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
Using con As SqlConnection = New SqlConnection(constr)
Using cmd As SqlCommand = New SqlCommand(query)
cmd.Parameters.AddWithValue("@Name", name)
cmd.Parameters.AddWithValue("@Technology", technology)
cmd.Connection = con
con.Open()
cmd.ExecuteNonQuery()
con.Close()
End Using
End Using