TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jigar Desai
NA
2.2k
2.2m
Ideal way to retrive dataset.
Jul 12 2004 2:48 PM
This is DataSet retriving code from
IBUYSPY
Events Module. public DataSet GetEvents(int moduleId) { // Create Instance of Connection and Command Object SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]); SqlDataAdapter myCommand = new SqlDataAdapter("GetEvents", myConnection); // Mark the Command as a SPROC myCommand.SelectCommand.CommandType = CommandType.StoredProcedure; // Add Parameters to SPROC SqlParameter parameterModuleId = new SqlParameter("@ModuleId", SqlDbType.Int, 4); parameterModuleId.Value = moduleId; myCommand.SelectCommand.Parameters.Add(parameterModuleId); // Create and Fill the DataSet DataSet myDataSet = new DataSet(); myCommand.Fill(myDataSet); // Return the DataSet return myDataSet; } My Question is 1) Is this ideal way to retrive data? 2) Will it return connection back to pool?
Reply
Answers (
3
)
Committing changes from bounded Windows Form controls
how to transfer data from excel to sql server table