Dim MyConnection As SqlClient.sqlConnection Dim MyCommand As Sqlclient.sqlCommand Dim MyReader As SqlClient.sqlDataReader Dim Strsql As String Dim Connstr AS String
strsql = "SELECT P_NAME FROM M_PLOR" Connstr = "Server = wherever; packet size = 4096; user ID = sa; password =" sa "; data source = ISO2; PERSIST SECU" & _ "RITY INFO = FALSE; Initial Catalog = "wuye"
MyConnection = New Sqlclient.sqlConnection (connStr) MyConnection.Open () mycommand = new sqlclient.sqlcommand (strsql, myconnection)
MyReader = MyCommand.executeReader
Dim n as integer n = myReader.fieldcount
Dim Str As String
ShipMethod.DataSource = MyReader shipMethod.DATABIND ()