PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET RE: Proper Way to Regenerate Parameters of a Command?

Reply

RE: Proper Way to Regenerate Parameters of a Command?

 
Thread Tools Rate Thread
Old 30-06-2003, 09:07 AM   #1
Kevin Sun [MS]
Guest
 
Posts: n/a
Default RE: Proper Way to Regenerate Parameters of a Command?


I cannot find a way to data command; however, if you use data adapter, I
hope the following information helps:

Under most circumstances, a data adapter's Command objects (SelectCommand,
InsertCommand, UpdateCommand, and DeleteCommand) reference SQL statements
or stored procedures that require parameters. If you have used the Data
Adapter Configuration Wizard to create the adapter, then the parameters for
these commands are configured for you automatically. However, you might
want to configure parameters manually or make small changes to an existing
parameters collection.

Tip To configure parameters after making changes to the SQL statement for
a command, you can choose the Regenerate parameters collection for this
command option in the Query Builder.


Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| From: "John Saunders" <john.saunders@surfcontrol.com>
| Subject: Proper Way to Regenerate Parameters of a Command?
| Date: Fri, 27 Jun 2003 17:39:32 -0400
| Lines: 26
| Organization: SurfControl, Inc.
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#55qfSPPDHA.1552@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: host254wb.surfcontrol.com 65.194.40.254
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:54457
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| If you drag a stored procedure from the Server Explorer onto a design
| surface, it places SqlConnection and SqlCommands on the design surface.
The
| SqlCommand has a Parameters collection which is filled in from the stored
| procedure you dragged.
|
| But what should you do when you change the parameters of the stored
| procedure? It would be nice if you could right-click the SqlCommand and
see
| "Regenerate Parameters" in the context menu, but there's no such thing. Is
| there a "proper" way to do this?
|
| The "improper" way I stumbled across is to change the name of the SP in
the
| CommandText property to something that doesn't exist in the database.
VS.NET
| will offer to regenerate the parameters, but it will fail to find that SP
in
| the database. You then change the name back to the real one. VS.NET will
| offer to regenerate the parameters, and this time will find the SP and the
| new parameters, and will succeed.
|
| But this is a hack, to say the least. Does anyone have a better way?
|
| --
| John Saunders
| Internet Engineer
| john.saunders@surfcontrol.com
|
|
|
|

  Reply With Quote
Old 03-07-2003, 09:12 AM   #2
Kevin Sun [MS]
Guest
 
Posts: n/a
Default RE: Proper Way to Regenerate Parameters of a Command?

You can search for key words "Configuring Parameters for Data Adapters" in
VS.NET help.

Based on my research, you can refresh the parameters as below:

1. In Server Explorer, close the connection and then refresh the connection.

2. In the design view, right OleDbDataAdapter control and select "Configure
Data Adapter" menu. The parameter change appears in the "Configure Data
Adapter" wizard.

3. Follow the wizard, you can refresh the parameter change by clicking
Finish button.




Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| From: John Saunders <anonymous@devdex.com>
| References: <sTVEgcuPDHA.1468@cpmsftngxa09.phx.gbl>
| X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
| Subject: RE: Proper Way to Regenerate Parameters of a Command?
| Mime-Version: 1.0
| Content-Type: text/plain; charset="us-ascii"
| Content-Transfer-Encoding: 7bit
| Message-ID: <#BlfttuPDHA.3192@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| Date: Mon, 30 Jun 2003 02:38:55 -0700
| NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
| Lines: 1
| Path: cpmsftngxa09.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa09.phx.gbl microsoft.public.dotnet.framework.adonet:9520
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| Kevin,
|
| Thanks for the response, but I'm unable to locate this "Regenerate
| Parameter Collection" command in the query builder. Could you please
| provide step-by-step instructions on how to regenerate a parameters
| collection?
|
| BTW, I'm not yet running Visual Studio 2003.
|
| John Saunders
| Internet Engineer
| john.saunders@surfcontrol.com
|
|
| *** Sent via Developersdex http://www.developersdex.com ***
| Don't just participate in USENET...get rewarded for it!
|

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off