Hi,
ich habe Probleme eine Datenbank-Connection per ADOConnection herzustellen.
Die Fehlermeldung sagt mir das der Namespec 'System.Data.ADO' nicht
gefunden wird!?
Gibt es eine bessere Moeglichkeit per ODBC-Schnittstelle auf eine Datenbank
zuzugreifen?
Gruss, Manuel
-------------------------------------------------------------
Ich verwende folgendes Script:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.ADO" %>
<script language=VB runat="server">
Sub Page_Load(Source As Object, E as EventArgs)
Dim strConn as String
Dim strSQL as String
Dim cnVerbindung as ADOConnection
Dim oDataSet as DataSet
Dim oDataSetCmd as ADODataSetCommand
strConn ="DSN=database;UID=;PWD=;"
strSQL ="SELECT * FROM table"
cnVerbindung = new ADOConnection(strConn)
cnVerbindung.Open()
oDataSetCmd = new ADODataSetCommand(strSQL, strConn)
oDataSet = new DataSet()
oDataSetCmd.FillDataSet(oDataSet,"table")
cnVerbindung.Close()
Tabelle.DataSource = oDataSet.Tables("table").DefaultView
Tabelle.DataBind()
End Sub
</script>
| [aspdedotnet] als [email protected] subscribed
| http://www.dotnetgerman.com/archiv/aspdedotnet/ = Listenarchiv
| Sie k�nnen sich unter folgender URL an- und abmelden:
| http://www.dotnetgerman.com/listen/aspDEdotnet.asp