Do not use: when database query is going to provide for sure exactly 1 record. It may be getting record by its id (which is PK in the database) - GetOrderById and such. In this case use ExecuteNonQuery with output parameters.
Use: when database query is going to provide a set of records. It may be search or report.
Use: when we are talking about a single database record - in Update, Insert, Delete and Get by Id. In all these cases we can use input/output/input-output parameters. Please note that from the application architecture point of view it is also good practices when your Insert and Update stored procedure returns changed record exactly like Get By Id method does.
Do not use: when database query returns a single value and this value can be defined as parameter in T-SQL. ExecuteNonQuery with output parameter(s) is always preferred in this case since it is more flexible, tomorrow there will be 2 values therefore having ExecuteNonQuery we do not need to change method signatures.
Use: when database query returns a single value and this value cannot be defined as output parameter, because of T-SQL type limitation for variables. For example type image cannot be output parameter in MSSQL.
The most common example for ExecuteScalar is fetching a single image stored in the database and converting it to array of bytes. If you google it - most examples will demonstrate using of ExecuteReader to accomplish image handler, however ExecuteScalar will be more scalable and faster.
Always use ExecuteNonQuery except: when you have a set of records - use ExecuteReader and when you have a single output value that cannot be defined as a parameter - use ExecuteScalar. Hope this helped to clarify something. Enjoy
Generally we use execute scalar function for displaying the first column and first row, but if we use ExecuteNonReader it will show error why because in asp.net only 3 commands are there ExecuteReader() ExecuteNonQuery() ExecuteScalar() this is the option to get one value from the database.
with help of coding it is possible with out any data base
If you plan to translate by your own, you would need database! If you want the conversion without too much of an effort, you can try a 3rd party translation service where you pass on the English words and get back the translated value. Google translate could be of help to start with.
I have a link of one webpage which is developed in dotnetnuke CMS and i want to view page source of page, the problem is that dotnetnuke does nt allow me to view page source programmatically.
How can I view page source programmatically?
You have to close the connection first before issuing a response.redirect, well you should at least, or else it can cause an error, or leave too many copies of the connector open. I would have to do research on that to confirm it, but I don't redirect when reading or writing data to a database.
Response.Redirect is the last thing you want to do in a sub, after closing and disposing of objects.
It's actually better to write a function without response.redirect, and have the function return a result or exit code, and then redirect.
if (0 = createStoredProcedure()) then