Respected Sir
can u Please TellME difference Between
cmd.Parameters.Add("@FirstName",SqlDbType.VarChar).Value = txtFirstName.Text.Trim();
And
cmd.Parameters.AddWithValue("@name", std.name);
here name is an ID name OF my name textbox....
There is no difference in terms of functionality.
For more details Refer
http://jwcooney.com/2012/09/10/asp-net-choosing-parameters-add-or-parameters-addwithvalue/
This method requires that you specify the DbType. This helps to reduce the likelihood of such errors.
This method takes an object as the value and there is no DataType type checking. that could leads to error if SQL Table column is of different type.
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.