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