Author | Message | Time |
---|---|---|
CupHead | As a precursor to developing my application on an SQL server, I'm working out the bugs and data access stuff locally using Access databases and reading them with the OleDbDataReader object. Currently, to access data, the code looks something like: (Database has one table, two columns, both are strings. [code] Do While MyReader.Read() TempString = MyReader.GetString(0) TempString2 = MyReader.GetString(1) Loop [/code] Is there any way to access the columns by name like we used to like: [code] TempString = MyRecordSet.Fields("Username").Value [/code] And when I move things to an SQL server, are my data access functions going to change? | November 12, 2003, 5:03 PM |
peofeoknight | yes, the syntax of sql statements should change somewhat for you, but it looks like you are using c# so I would not know how. I use c# but not often. btw you are going to need to change this <%@ Import Namespace="System.Data.OLEDB" %> to this <%@ Import Namespace="System.Data.SqlClient" %> hope this helps :) | November 19, 2003, 11:47 PM |