-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: uva_net
Message 2 in Discussion

1. Write a class which gets [connection_string and sql_query] as parameters and 
returns a datatable. 2. Add the datatables returned from the class into a 
dataset [either with name or index] 3. Assign the datasource for all your 5 
dropdownlist boxes with the tables in the dataset 4. databind();   but this is 
a onetime process... so better we can go for datareader in a loop...   correct 
me if I m wrong...   regds, Uvaraj AT Arman Infotech Systems Pvt. Ltd. 
Bangalore.   note: I m using the following code... jus chk n use if u require.  
       
Imports System.Data.SqlClient 
Public Class SQLDataBase 
Dim _connection As String 
Dim _command As String 
Dim _msg As String 
Public Sub New(ByVal ConnectionString As String, ByVal CommandText As String) 
_connection = ConnectionString 
_command = CommandText 
End Sub 
Public Function getMessage() As String 
Return _msg 
End Function 
Public Function getResultAsDataSet() As DataSet 
If _connection <> "" And _command <> "" Then 
Dim Con As New SqlConnection() 
Dim cmd As New SqlCommand() 
Dim da As New SqlDataAdapter() 
Try 
Con.ConnectionString = _connection 
Con.Open() 
cmd.CommandText = _command 
cmd.Connection = Con 
da.SelectCommand = cmd 
Dim ds As New DataSet() 
da.Fill(ds) 
da.Dispose() 
cmd.Dispose() 
Con.Close() 
Return ds 
Catch ex As Exception 
da.Dispose() 
cmd.Dispose() 
Con.Close() 
_msg = ex.Message 
Return Nothing 
End Try 
Else 
_msg = "Connection string & command text not initialized" 
Return Nothing 
End If 
End Function 
End Class

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to