Derzeit (ASP/VB) mache ich es folgendermassen:
------------------------------------------
dim connCC
Set connCC = Server.CreateObject("ADODB.Connection")
connectCC.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/Datenbanken/levelratingNetwork.mdb")
Set SQLresult = connectCC.execute("SELECT ....... ")
While (NOT(SQLresult.EOF))
.....
SQLresult.MoveNext
Wend
connectCC.Close
Set connectCC = nothing
set SQLresult = nothing
------------------------------------------
Kann mir das jemand in C# übersetzen?
Ich frage, weil ich schon beim simpelsten Zeugs scheitere:
------------------------------------------
<%@ Page Language="C#" %>
<%@ Import Namespace="System" %>
<%
string CONNSTR="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("/Datenbanken/LevelratingNetwork.mdb")+ ";Persist Security Info=False";
string sqlInsert="INSERT INTO Bestellung (Nachname) VALUES ('Otto')";
System.Data.OleDbConnection conn1 = new OleDbConnection(CONNSTR);
%>
------------------------------------------
Fehlermeldung:
"The type or namespace name 'OleDbConnection' does not exist in the class or namespace 'System.Data' (are you missing an assembly reference?)"
Hoffe, es kann jemand helfen, danke
Michael
------------------------------------------
dim connCC
Set connCC = Server.CreateObject("ADODB.Connection")
connectCC.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/Datenbanken/levelratingNetwork.mdb")
Set SQLresult = connectCC.execute("SELECT ....... ")
While (NOT(SQLresult.EOF))
.....
SQLresult.MoveNext
Wend
connectCC.Close
Set connectCC = nothing
set SQLresult = nothing
------------------------------------------
Kann mir das jemand in C# übersetzen?
Ich frage, weil ich schon beim simpelsten Zeugs scheitere:
------------------------------------------
<%@ Page Language="C#" %>
<%@ Import Namespace="System" %>
<%
string CONNSTR="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("/Datenbanken/LevelratingNetwork.mdb")+ ";Persist Security Info=False";
string sqlInsert="INSERT INTO Bestellung (Nachname) VALUES ('Otto')";
System.Data.OleDbConnection conn1 = new OleDbConnection(CONNSTR);
%>
------------------------------------------
Fehlermeldung:
"The type or namespace name 'OleDbConnection' does not exist in the class or namespace 'System.Data' (are you missing an assembly reference?)"
Hoffe, es kann jemand helfen, danke
Michael