|
-
Sep 9th, 2003, 08:47 AM
#1
Thread Starter
Fanatic Member
Type 'OdbcConnection' is not defined.
Can someone tell me what is wrong with this line of code (*):
When I use this in a code behind page it is fine but when I try with inline coding I get the following error message :
Type 'OdbcConnection' is not defined.
Here is the code :
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
* Dim myConn As OdbcConnection = New OdbcConnection("driver={MySql};uid=root;pwd=;server=127.0.0.1;database=mybase;OPTION=17923")
myConn.open
dim command as string = "Select * from tblMicrosites"
dim ds as new dataset()
dim adaptor as odbcdataadaptor = new odbcdataadaptor(command, connect)
dim cmdbuilder as odbccommandbuilder(adaptor)
adaptor.fill(ds)
dim i as integer
for i = 0 to ds.tables(0).rows.count - 1
ds.tables(0).rows(i).item(3) = "test"
end
adaptor.updatecommand = cmdbuilder.getupdatecommand()
adaptor.update(ds.table(0))
End Sub
</script>
</html>
Thanks in Advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|