Jump to content

asp.net help


abeetha.m

Recommended Posts

i wrote some code here,in this code stored procedure is returning a datareader objectSqlConnection sqlConnection1 = new SqlConnection("Your Connection String");SqlCommand cmd = new SqlCommand();SqlDataReader reader;cmd.CommandText = "StoredProcedureName";cmd.CommandType = CommandType.StoredProcedure;cmd.Connection = sqlConnection1;sqlConnection1.Open();reader = cmd.ExecuteReader();sqlConnection1.Close();now::: in the same is there any method which returns dataset???

Link to comment
Share on other sites

Hi,Instead of a DataReader, make use of DataSet object.You can have a function which will return a dataset.example: System.Data.DataSet function_name(){//your code herereturn //your dataset object.}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...