How to implement sqlhelper parameter cache
I use SqlHelperParameterCache classes to handle my application DAL. This is a class which will help the application talk to the database from the presentation, For some reason my insert no longer works using the SqlHelperParameterCache.GetSpParameterSet under version 2. I thought they are used for improving performance. But I make a example to test the performance against with caching and without caching. Is there a example that uses this during data That's being edited in a textbox/ or just data in general?
Re: How to implement sqlhelper parameter cache
Based on my understanding, you want to use the SQLhelper's ExecuteNonQueryTypedParams method to update the data. Here i am giving you small query that will allow you to implement your necessities.
((p.Direction == ParameterDirection.InputOutput || p.Direction == ParameterDirection.Input) && (p.Value == null))
{
p.Value = DBNull.Value;
}
command.Parameters.Add(p);
Re: How to implement sqlhelper parameter cache
The ExecuteNonQueryTypedParams method is used to execute a stored procedure. It has three parameters:You just need to pass the connection string and the database query the rest will be handled by this class.
connectionString: The connection string for a SqlConnection.
spName: The name of the stored procedure that you want to execute(In your case, it is your update statement stored procedure's name).
dataRow: The dataRow is used to hold the stored procedure's parameter values.
restoring a good set puts it back to the default configuration and any config problems can be solved that way for instance if you had bad settings, Sqlhelper will pull the parameters for this stored procedure from the parameter cache and set the parameters values from dataRow. Besides, dataRow need to contain the column name that should be the same as the stored procedure parameter's name.
Re: How to implement sqlhelper parameter cache
In your case, we should write an update statement stored procedure with the TextBox's Text as parameter and then create the DataRow with the TextBox's Text. When Winsock corrupts, the networking errors that you may face include unable to surf the Internet with “Page cannot be displayed” error message in Internet Explorer or AOL even though the DSL/ADSL/cable Internet connection is connected.