This blog is subject the DISCLAIMER below.

Friday, August 15, 2008

How to use dataset and adapters with stored procedures?

Q: How to use dataset and adapters with stored procedures?

A: I've asked this question two times today, and for that I thought to do a post and send the link better to answer everyone separately..

Right now, I've be_settings table, its schema (SettingName nvarchar(50) and SettingValue nvarchar(MAX)) what I need is to create stored procedure to get SettingName and SettingValue when the SettingValue = some value


then let's go to Visual Studio and create windows application and drop DataGridView on the form; press on the smart arow located on its top right, new dialog appears, choose to add new data source->Add project data source->Database




then finish...

Your form should look like

after choosing datasource

in Load data onClick event handler, write this code

code to load data

Just, Ctr + F5 and lets test our work


Hope, I answered your question ",)

Tip: if you using Windows Vista you need to run Visual Studio and SQL Server as administrator....

No comments: