S
shimmer
Hi.
i have a code as below. When i define ADOCommand as well as
ADOConnection, they do not work but i have already defined
<%@Import Namespace=System.Data.ADO%>
<%@Import Namespace=System.Data%>
Can anyone help me? Thank you
Code:
<%@Import Namespace=System.Data%>
<%@Import Namespace=System.Data.ADO%>
<Html>
<Form id="F1" Runat="Server">
Enter Query: <Input Type="Text" Id="Text1" Runat="Server" >
<Button ID="Button1" Runat="Server"
OnServerClick="Button1_Click">
Execute
</Button>
</form>
<Span ID="Sp1" Runat="Server"/>
<Script Language="VB" Runat="Server">
Sub Button1_Click(sender As Object, E As EventArgs)
Dim cnA As ADOConnection=New ADOConnection
Dim cmA As ADOCommand=New ADOCommand
cnA.Provider="Microsoft.Jet.OLEDB.4.0"
cnA.DataSource="C:\MyWeb.mdb"
cnA.UserID="Admin"
cnA.Open()
cmA.ActiveConnection=cnA
cmA.CommandType=CommandType.Text
cmA.CommandText=Text1.Value
cmA.Execute()
Sp1.InnerText="This will affect" & cmA.RecordsAffected & "
....."
End Sub
</SCRIPT>
</Html>
i have a code as below. When i define ADOCommand as well as
ADOConnection, they do not work but i have already defined
<%@Import Namespace=System.Data.ADO%>
<%@Import Namespace=System.Data%>
Can anyone help me? Thank you
Code:
<%@Import Namespace=System.Data%>
<%@Import Namespace=System.Data.ADO%>
<Html>
<Form id="F1" Runat="Server">
Enter Query: <Input Type="Text" Id="Text1" Runat="Server" >
<Button ID="Button1" Runat="Server"
OnServerClick="Button1_Click">
Execute
</Button>
</form>
<Span ID="Sp1" Runat="Server"/>
<Script Language="VB" Runat="Server">
Sub Button1_Click(sender As Object, E As EventArgs)
Dim cnA As ADOConnection=New ADOConnection
Dim cmA As ADOCommand=New ADOCommand
cnA.Provider="Microsoft.Jet.OLEDB.4.0"
cnA.DataSource="C:\MyWeb.mdb"
cnA.UserID="Admin"
cnA.Open()
cmA.ActiveConnection=cnA
cmA.CommandType=CommandType.Text
cmA.CommandText=Text1.Value
cmA.Execute()
Sp1.InnerText="This will affect" & cmA.RecordsAffected & "
....."
End Sub
</SCRIPT>
</Html>