mike55 Posted September 22, 2004 Posted September 22, 2004 Hi, Have been given code to look through and to convert to SQL Server 2000. The project is currently linked to Access. The problem is with the following method... Friend Function FillAbsentDataset(byval strAbs as string, byval strDSAbs as string, strSqlCC as string) as dataset Dim daDataAdapter as oledbDataAdapter dim dbconConnection as System.data.idbConnection = new oledbconnection(strConnectionString) 'strConnectionString is defined earlier dim dsDataset as dataset dsDataset = new dataset daDataAdapter = new OledbDataAdapter(strSqlAbs, dbconConnection) dbConnection.close() End Function Would i be correct in saying that the line daDataAdapter = new OledbDataAdapter(strSqlAbs, dbConnection) is basically saying that strSqlAbs is my select statement, and that the line is a quick way of executing the sql statement??? I usually execute a sql select statement by doing the following... connect() 'My connection string conSQL.open commSQL.connection = conSQL commSQL.commandType = CommandType.Text commSQL.commandText = The select statement daDataAdapter.selectcommand = commSQL conSQL.close Would appreciate any comments, on either piece of code. Mike55 Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
*Experts* Nerseus Posted September 22, 2004 *Experts* Posted September 22, 2004 In both cases you're not actually doing the Fill. After you have "daDataAdapter = new OledbDataAdapter(strSqlAbs, dbconConnection)" you need to use daDataAdapter.Fill to fill a dataset based on your SELECT (or exec of a proc, etc.). -ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.