Tag Archives: QueryString

Error msg: No mapping exists from object type System.Data.SqlClient.SqlParameter to a known managed provider native type.

        Dim pID As New SqlParameter(“@ID”, SqlDbType.Int)         pID.Value = TextBoxParentID.Text         cmd.Parameters.AddWithValue(“@ID”, pID) I changed it to:         Dim pID As New SqlParameter(“@ID”, SqlDbType.Int)         pID.Value = TextBoxParentID.Text         cmd.Parameters.Add(pID) and it works also this works:         Dim pID … Continue reading

Posted in Databases, Programming, SQL-Server, VB.NET | Tagged , , , , , | 3 Comments

ExecuteReader vs ExecuteNonQuery vs ExecuteScalar

ExecuteReader() For SELECT statement ExecuteNonQuery() For INSERT , UPDATE and DELETE Not for SELECT statement. ExecuteScalar() For images   Ahmed.

Posted in Comparison, Databases, Programming, SQL-Server, VB.NET | Tagged , , , , , , , , , | Leave a comment

Sending data to another page

There are many ways to send data to another page. QueryString , Context or Session. The easiest and oldest way is QueryString. In first page: Link second page and variable e.g. NavigateUrl = “~/SecondPage.aspx?variable_to_be_send=1” In second page: Protected Sub Page_Load(ByVal … Continue reading

Posted in Programming, VB.NET | Tagged , | Leave a comment