Hi there, hope you can help me, I am in the process of updating our company's web pages from asp to asp.net, and have run into a problem accessing database.
I am trying to make the most of asp.net's features including the <asp:repeater /> tag, but i need to have a data source tag. I managed to connect to the database normally like so:
Dim objConn = Server.CreateObject("ADODB.Connection")
Dim rstSource = Server.CreateObject("ADODB.Recordset")
Dim strSQL, myStr
objConn.Open ("DSN=myDSNConnection")
strSQL = "SELECT * FROM myTable ORDER BY fieldOne;"
rstSource= objConn.Execute(strSQL)
Do while not rstSource.eof
myStr &= rstSource("Cyfenw").Value & "<br/>"
rstSource.MoveNext
loop
myContent.text = myStr
but I don't know how to put this in a dtatSource tag - I've found loads of tutorials that show how to do it with normal connections to databases but not using the DSN.
Any help will be appreciated. Thanks
Gareth
A computer always does what you tell it to, but rarely does what you want it to.....
I am trying to make the most of asp.net's features including the <asp:repeater /> tag, but i need to have a data source tag. I managed to connect to the database normally like so:
Dim objConn = Server.CreateObject("ADODB.Connection")
Dim rstSource = Server.CreateObject("ADODB.Recordset")
Dim strSQL, myStr
objConn.Open ("DSN=myDSNConnection")
strSQL = "SELECT * FROM myTable ORDER BY fieldOne;"
rstSource= objConn.Execute(strSQL)
Do while not rstSource.eof
myStr &= rstSource("Cyfenw").Value & "<br/>"
rstSource.MoveNext
loop
myContent.text = myStr
but I don't know how to put this in a dtatSource tag - I've found loads of tutorials that show how to do it with normal connections to databases but not using the DSN.
Any help will be appreciated. Thanks
Gareth
A computer always does what you tell it to, but rarely does what you want it to.....