Re: Design Time Data
Brady Kelly <[email protected]> Wed, 14 Nov 2007 19:02:43 +0200
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Message-ID | <[email protected]> |
Hi Rich I can't make out very much of your post, but regarding parameters for stored procs: What I do is create a new dataset, then drag a stored proc from Server Explorer onto it. That creates a DataTable and a TableAdapter, and a default Fill method using the stored proc I dragged. I then right click the TableAdapter in the dataset designer, and select additional, existing, stored procs for update, insert, and delete. If the parameter names for the latter three match the column names selected in the first proc, VS auto-magically handles passing these parameters. > -----Original Message----- > From: Discussion forum for developers using Windows Forms to build apps > and controls [mailto:[email protected]] On Behalf Of > R. Rogers > Sent: 14 November 2007 06:23 PM > To: [email protected] > Subject: [DOTNET-WINFORMS] Design Time Data > > Hello, > > So far in my relatively simple winforms app, I $B!G (Bve been doing all > database > work in code. I do all the following in code: > - Instantiate a SqlConnection and connect > - Instantiate a SqlCommand and a whole bunch of SqlParameter objects to > call > a stored procedure > > This is working well, but is time consuming. I like the fact that I > have a > lot of control this way and can use the SQL Server optimized classes. > The only downside is it $B!G (Bs time consuming and code maintenance > might become > a burden. > > I would like it if VS would at least be able to setup the parameters > for the > stored proc. > To move in that direction, I started a new project, and clicked on > $B!F (BData $B!G (B > $B"* (B $B!F (BAdd new Data Source $B!G (B. > > I $B!G (Bve now got an associated $B!H (Bdata module $B!I (B (Delphi > speak). I thought I $B!G (Bd > be able to create connections and commands at design time, but this isn > $B!G (Bt > so. The only components I see under the data section are: > - Dataset > - DataGridView > - BindingSource > - BindingNavigator > > I expected to see SqlConnection, SqlCommand, etc. > Could someone enlighten me, with perhaps a weblink or two? > > Much appreciated! > > Richard Rogers > http://www.RichardRogers.ca/ > (MSN) [email protected]