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 April 7th, 2004, 03:46 PM
Registered User
 
Join Date: Apr 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default sqlDataAdapter

When using the Data Adapter Configuration Wizard in VB.net inside a component class; One can choose "Use existing stored Procedures".

Although I can populate the sqlAdapter(store procedure input parameter) at design; I have no clue on how to pass values from another windows form to the component class(sqlAdapter) at runtime.

Thanks,
WebGuy

Sample code:
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.SqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter
        Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand
        Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
        '
        'SqlDataAdapter1
        '
        Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1
        Me.SqlDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "dbo_login", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("IntraEmploId ", "IntraEmploId"), New System.Data.Common.DataColumnMapping("IntraLevelId ", "IntraLevelId")})})
        '
        'SqlSelectCommand1
        '
        Me.SqlSelectCommand1.CommandText = "dbo.[login]"
        Me.SqlSelectCommand1.CommandType = System.Data.CommandType.StoredProcedure
        Me.SqlSelectCommand1.Connection = Me.SqlConnection1
        Me.SqlSelectCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@RETURN_VALUE" , System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, False, CType(0, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing))
        Me.SqlSelectCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@user", System.Data.SqlDbType.VarChar, 16, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, "xxxx"))
        Me.SqlSelectCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Password2", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, "xxxx"))
        '
        'SqlConnection1
        '
        Me.SqlConnection1.ConnectionString = "workstation id=xxxx;packet size=4096;user id=xxxx;data source=xxx;p" & _
        "ersist security info=True;initial catalog=xxxx;password=xxxx"

    End Sub

 
Old April 8th, 2004, 12:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

If u wanna set that params to work with specified SP's u dont need to work with parameters directly!
i'll update ur DataSet (Update, Delete, Insert) & call sqlAdapter.Update method. It'll call & set all params itself.

I hope I got ur problem,HTH.

Always:),
Hovik Melkomian.





Similar Threads
Thread Thread Starter Forum Replies Last Post
sqldataadapter vgsgowrisankar C# 2005 7 April 23rd, 2008 04:32 PM
SqlDataAdapter DanRoche .NET Framework 1.x 3 August 20th, 2007 04:04 AM
SqlDataAdapter does not have its properties thaopham215 ASP.NET 2.0 Basics 13 December 6th, 2006 05:15 PM
SqlDataAdapter Issue Tom Wing VB.NET 2002/2003 Basics 2 February 6th, 2006 01:43 PM





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