Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 3rd, 2005, 03:59 AM
Authorized User
 
Join Date: Feb 2005
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ashokparchuri Send a message via Yahoo to ashokparchuri
Default how to make it work?

hello,
i am working with a stored procedure in this i have to pass values from nearly 30 controls to stored procedure.

   after declaring the connection string to cn i just did like this..

        cmd = New SqlCommand()
        cmd.Connection = cn
        cmd.CommandType = CommandType.StoredProcedure
        cmd.CommandText = "sp_ConsultantMaint" 'SV', '-999',"
   in the above line i want to pass some vcalues to stored procedure.becuse stored procedure is written with "if" condition.

     after doing like this i just tried to pass the values like below..
      Dim email As New SqlParameter("@Email", SqlDbType.VarChar, 100)
      cmd.Parameters.Add(email)
      email.Direction = ParameterDirection.Input
      email.Value = txtemail.Text

    the parameters i passed"@Email is same as in the stored procedure.
like this i had written for nearly about 30 controls.

first i declared all parameters
second i gave add condition for all parameters
third i had given direction
and 4th i just gave the control names from where the parameters has to get the values.

i thought this code will work properly..but the program is executing and the values are not inserted into the database.

   at the end i used cmd.execuitenonquery() statement..
please help me how to solve..

thanks in advance-ashok
 
Old March 3rd, 2005, 09:13 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I don't see where you open the connection.

 
Old March 4th, 2005, 07:00 AM
Authorized User
 
Join Date: Feb 2005
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ashokparchuri Send a message via Yahoo to ashokparchuri
Default

hi...i said after declaring the connection string i had written this code...
any way i found the answer...the store procedure i am using is having some mistakes.

anyway thanks for your response....ashok





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to make htaccess work. markdawkins BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 April 17th, 2011 02:31 PM
Cannot make site work wenlanli BOOK: ASP.NET Website Programming Problem-Design-Solution 1 September 3rd, 2004 11:39 AM
Can't make sample project work sillygiu@hotmail.com All Other Wrox Books 1 August 17th, 2004 03:02 AM
Cannot make my IIS work w_erik BOOK: Beginning ASP.NET 1.0 2 May 11th, 2004 02:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.