S
Steven
I first have to be honest. I am new to ASP.NET 2 (well, ASP in
general). I have mostly PHP background. So please try to keep any
responses somewhat simple.
First of all, on my XP machine. I have IIS installed, using a Virtual
Directory for my site, and I have set it to use ASP.NET version
2.0.50727. I also have MySQL version 4.0.20 running. I have also
installed MySQL Connector/ODBC 3.51 and MySQL Connector NET 5.0.6.
OK.. First of all what else do I need to get connected? Second of all
HOW do I connect? I have seen a tons of complexed ways and none of
them make any scene or work.
I have also seen something about .NET 2 not using record sets.
Everyone keeps putting the data in a datagrid. I don't get it.
Last but not least. The site will be hosted at GoDaddy.com. They have
a sample connection script that looks like this:
------------------------------------------------------------------------------------------------------------------------------------
<%
Dim oConn, oRs
Dim qry, connectstr, sDSNDir
Dim db_name, db_username, db_userpassword
Dim db_server, dsn_name
dsn_name = "your_dsn_name"
fieldname = "your_fieldname"
tablename = "your_tablename"
sDSNDir = Server.MapPath("_dsn")
connectstr = "filedsn=" & sDSNDir & "" & dsn_name
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open connectstr
qry = "SELECT * FROM " & tablename
Set oRS = oConn.Execute(qry)
if not oRS.EOF then
while not oRS.EOF
response.write ucase(fieldname) & ": " & oRs.Fields(fieldname) & "
"
oRS.movenext
wend
oRS.close
end if
Set oRs = nothing
Set oConn = nothing
%>
------------------------------------------------------------------------------------------------------------------------------------
It seems to be missing somethings, like where to put the user name and
password. And what is this Server.MapPath("_dsn") ?
Please help.. I have been trying over two weeks trying to figure this
out..
Thank you VERY much in advance.
general). I have mostly PHP background. So please try to keep any
responses somewhat simple.
First of all, on my XP machine. I have IIS installed, using a Virtual
Directory for my site, and I have set it to use ASP.NET version
2.0.50727. I also have MySQL version 4.0.20 running. I have also
installed MySQL Connector/ODBC 3.51 and MySQL Connector NET 5.0.6.
OK.. First of all what else do I need to get connected? Second of all
HOW do I connect? I have seen a tons of complexed ways and none of
them make any scene or work.
I have also seen something about .NET 2 not using record sets.
Everyone keeps putting the data in a datagrid. I don't get it.
Last but not least. The site will be hosted at GoDaddy.com. They have
a sample connection script that looks like this:
------------------------------------------------------------------------------------------------------------------------------------
<%
Dim oConn, oRs
Dim qry, connectstr, sDSNDir
Dim db_name, db_username, db_userpassword
Dim db_server, dsn_name
dsn_name = "your_dsn_name"
fieldname = "your_fieldname"
tablename = "your_tablename"
sDSNDir = Server.MapPath("_dsn")
connectstr = "filedsn=" & sDSNDir & "" & dsn_name
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open connectstr
qry = "SELECT * FROM " & tablename
Set oRS = oConn.Execute(qry)
if not oRS.EOF then
while not oRS.EOF
response.write ucase(fieldname) & ": " & oRs.Fields(fieldname) & "
"
oRS.movenext
wend
oRS.close
end if
Set oRs = nothing
Set oConn = nothing
%>
------------------------------------------------------------------------------------------------------------------------------------
It seems to be missing somethings, like where to put the user name and
password. And what is this Server.MapPath("_dsn") ?
Please help.. I have been trying over two weeks trying to figure this
out..
Thank you VERY much in advance.