|
 |
aspx thread: Problem in accessing the data
Message #1 by "Lata Shah" <lalithashank@h...> on Wed, 7 Nov 2001 11:15:18
|
|
The WHERE clause does not seem to be working. Could anybody please help me
in debigging the code down below. I am pasting the code here:
DISPLAY.ASPX
<html>
<title>ADDRESS DIARY</title>
<head>
<h1><center><u>Online Address Diary</u></center></h1>
<body bgcolor="iceblue">
<form method="POST" action="/aspnet/Projects/AddressDiary/address1.aspx"
runat="server">
<table>
<tr>
<td>Choose :</td>
<td>
<asp:DropDownList id="droplist" runat="server">
<asp:ListItem>FirstName</asp:ListItem>
<asp:ListItem>LastName</asp:ListItem>
<asp:ListItem>City</asp:ListItem>
<asp:ListItem>Country</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
<br><br><br><br>
<table>
<tr>
<td>Enter here :</td>
<td><asp:TextBox id="text" runat="server"/></td>
</tr>
</table>
<p><center><input type="Submit" name="b1" value="Enter"></p>
</form>
</body>
</head>
</html>
ADDRESS1.ASPX
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.ADO" %>
<html>
<script language="C#" runat="server" debug="true">
string selfield = "";
string seltext = "";
void Page_Load(Object o, EventArgs e)
{
selfield = Request.Form["droplist"];
seltext = Request.Form["text"];
Response.Write(selfield);
Response.Write(seltext);
ADODataReader dr;
String s= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source =
D:/Lalitha/databases/AddressData.mdb ";
ADOConnection connec = new ADOConnection(s);
ADOCommand comm = new ADOCommand();
comm.CommandType = CommandType.Text;
comm.CommandText = "select * from address where FirstName =
@seltext ";
comm.ActiveConnection = connec;
connec.Open();
comm.Execute(out dr);
while (dr.Read())
{
Response.Write(dr["FirstName"].ToString() + " ");
Response.Write(dr["LastName"].ToString() + " ");
Response.Write(dr["Email"].ToString() + " ");
Response.Write("<br><br><br>");
}
}
</script>
</html>
Thanks,
Lata.
Message #2 by "S. Asif Imam" <asifimam@y...> on Wed, 7 Nov 2001 19:03:22 +0500
|
|
> comm.CommandText = "select * from address where FirstName
> @seltext ";
--> @seltext "; this indicate a command parameter
correct will be either *******(using System.Data.OleDb;)*****
comm.CommandText = "select * from address where FirstName = @seltext ";
comm.Parameters.Add (new OleDbParameter("@seltext", OleDbType.VarChar));
comm.Parameters["@seltext"].Value = seltext;
OR
Directly specify the value in string like ..
comm.CommandText = "select * from address where FirstName = ' " + seltext "'
" ; //dont miss the single quotes..
let me know if it problem persists.
----- Original Message -----
From: "Lata Shah" <lalithashank@h...>
To: "ASP+" <aspx@p...>
Sent: Wednesday, November 07, 2001 11:15 AM
Subject: [aspx] Problem in accessing the data
> The WHERE clause does not seem to be working. Could anybody please help me
> in debigging the code down below. I am pasting the code here:
>
> DISPLAY.ASPX
>
> <html>
> <title>ADDRESS DIARY</title>
> <head>
> <h1><center><u>Online Address Diary</u></center></h1>
> <body bgcolor="iceblue">
> <form method="POST" action="/aspnet/Projects/AddressDiary/address1.aspx"
> runat="server">
> <table>
> <tr>
> <td>Choose :</td>
> <td>
> <asp:DropDownList id="droplist" runat="server">
> <asp:ListItem>FirstName</asp:ListItem>
> <asp:ListItem>LastName</asp:ListItem>
> <asp:ListItem>City</asp:ListItem>
> <asp:ListItem>Country</asp:ListItem>
> </asp:DropDownList>
> </td>
> </tr>
> </table>
> <br><br><br><br>
> <table>
> <tr>
> <td>Enter here :</td>
> <td><asp:TextBox id="text" runat="server"/></td>
> </tr>
> </table>
> <p><center><input type="Submit" name="b1" value="Enter"></p>
> </form>
> </body>
> </head>
> </html>
>
>
>
>
> ADDRESS1.ASPX
>
> <%@ Import Namespace="System" %>
> <%@ Import Namespace="System.Data" %>
> <%@ Import Namespace="System.Data.ADO" %>
>
>
> <html>
>
> <script language="C#" runat="server" debug="true">
>
> string selfield = "";
> string seltext = "";
>
> void Page_Load(Object o, EventArgs e)
> {
> selfield = Request.Form["droplist"];
> seltext = Request.Form["text"];
>
> Response.Write(selfield);
> Response.Write(seltext);
> ADODataReader dr;
>
> String s= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source
> D:/Lalitha/databases/AddressData.mdb ";
>
> ADOConnection connec = new ADOConnection(s);
> ADOCommand comm = new ADOCommand();
>
> comm.CommandType = CommandType.Text;
> comm.CommandText = "select * from address where FirstName
> @seltext ";
> comm.ActiveConnection = connec;
>
> connec.Open();
>
> comm.Execute(out dr);
>
> while (dr.Read())
> {
> Response.Write(dr["FirstName"].ToString() + " ");
> Response.Write(dr["LastName"].ToString() + " ");
> Response.Write(dr["Email"].ToString() + " ");
> Response.Write("<br><br><br>");
> }
>
>
> }
> </script>
>
> </html>
>
>
> Thanks,
> Lata.
>
> ---
> VBug Winter Conference 2001
>
> Open Forum: Dan Appleman will be hosting an open
> forum at The .NET Developer's Conference on
> 29th November 2001. The session will give
> developers the chance to discuss and question
> Dan on his experience with the .NET environment.
> Dan has been programming Visual Basic since the
> alpha version 1.0. And with over 10 years
> Visual Basic experience is well qualified to
> help you on your road to being a .NET Guru.
>
> http://www.vbug.co.uk/redirect.asp?url=39&id=17
>
> ---
> You are currently subscribed to
> aspx as: asifimam@y...
> $subst('Email.Unsub')
Message #3 by "Al LeMay" <alemay@d...> on Wed, 7 Nov 2001 08:45:13 -0800
|
|
Lata
When dealing with strings you must use the "like" command in SQL
statements.
Example:
Select * from table where column like @string
If you choose to execute the "=3D" you will never get a match because
the
column may be defined as NVARCHAR(25) but you string is only 15
characters long. Thus the two are never equal to each other.
I would also advise that you create stored procedures whenever possible.
Then you need only call the stored procedure and the command text you
are using never can be missed typed.
Hope this helps.
Al LeMay
Virtuoso, Ltd.
Quality Assurance Manager
alemay@d...
-----Original Message-----
From: Lata Shah [mailto:lalithashank@h...]
Sent: Wednesday, November 07, 2001 3:15 AM
To: ASP+
Subject: [aspx] Problem in accessing the data
The WHERE clause does not seem to be working. Could anybody please help
me
in debigging the code down below. I am pasting the code here:
DISPLAY.ASPX
<html>
<title>ADDRESS DIARY</title>
<head>
<h1><center><u>Online Address Diary</u></center></h1>
<body bgcolor=3D"iceblue">
<form method=3D"POST"
action=3D"/aspnet/Projects/AddressDiary/address1.aspx"
runat=3D"server">
<table>
<tr>
<td>Choose :</td>
<td>
<asp:DropDownList id=3D"droplist" runat=3D"server">
<asp:ListItem>FirstName</asp:ListItem>
<asp:ListItem>LastName</asp:ListItem>
<asp:ListItem>City</asp:ListItem>
<asp:ListItem>Country</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
<br><br><br><br>
<table>
<tr>
<td>Enter here :</td>
<td><asp:TextBox id=3D"text" runat=3D"server"/></td>
</tr>
</table>
<p><center><input type=3D"Submit" name=3D"b1" value=3D"Enter"></p>
</form> </body> </head> </html>
ADDRESS1.ASPX
<%@ Import Namespace=3D"System" %>
<%@ Import Namespace=3D"System.Data" %>
<%@ Import Namespace=3D"System.Data.ADO" %>
<html>
<script language=3D"C#" runat=3D"server" debug=3D"true">
string selfield =3D "";
string seltext =3D "";
=09
void Page_Load(Object o, EventArgs e)
{
selfield =3D Request.Form["droplist"];
seltext =3D Request.Form["text"];
=09
Response.Write(selfield);
Response.Write(seltext);
ADODataReader dr;
=09
String s=3D "Provider=3DMicrosoft.Jet.OLEDB.4.0;Data Source =3D
D:/Lalitha/databases/AddressData.mdb ";
=09
ADOConnection connec =3D new ADOConnection(s);
ADOCommand comm =3D new ADOCommand();
=09
comm.CommandType =3D CommandType.Text;
comm.CommandText =3D "select * from address where FirstName =3D
@seltext ";
comm.ActiveConnection =3D connec;
=09
connec.Open();
=09
comm.Execute(out dr);
=09
while (dr.Read())
{
Response.Write(dr["FirstName"].ToString() + " ");
Response.Write(dr["LastName"].ToString() + " ");
Response.Write(dr["Email"].ToString() + " ");
Response.Write("<br><br><br>");
}
=09
=09
}
</script>
=09
</html>
Thanks,
Lata.
---
VBug Winter Conference 2001
Open Forum: Dan Appleman will be hosting an open
forum at The .NET Developer's Conference on
29th November 2001. The session will give
developers the chance to discuss and question
Dan on his experience with the .NET environment.
Dan has been programming Visual Basic since the
alpha version 1.0. And with over 10 years
Visual Basic experience is well qualified to
help you on your road to being a .NET Guru.
http://www.vbug.co.uk/redirect.asp?url=3D39&id=3D17
---
You are currently subscribed to
aspx as: alemay@d...
$subst('Email.Unsub')
Message #4 by "Lata Shah" <lalithashank@h...> on Wed, 7 Nov 2001 16:59:22
|
|
When I include Import namespace System.Data.OleDb....., it gives an error
saying System.Data does not support. Why? Is it because I am using the
beta 1 version. If so how do I upgrade to beta 2? Kindly help.
> The WHERE clause does not seem to be working. Could anybody please help
me
> in debigging the code down below. I am pasting the code here:
>
> DISPLAY.ASPX
>
> <html>
> <title>ADDRESS DIARY</title>
> <head>
> <h1><center><u>Online Address Diary</u></center></h1>
> <body bgcolor="iceblue">
> <form method="POST" action="/aspnet/Projects/AddressDiary/address1.aspx"
> runat="server">
> <table>
> <tr>
> <td>Choose :</td>
> <td>
> <asp:DropDownList id="droplist" runat="server">
> <asp:ListItem>FirstName</asp:ListItem>
> <asp:ListItem>LastName</asp:ListItem>
> <asp:ListItem>City</asp:ListItem>
> <asp:ListItem>Country</asp:ListItem>
> </asp:DropDownList>
> </td>
> </tr>
> </table>
> <br><br><br><br>
> <table>
> <tr>
> <td>Enter here :</td>
> <td><asp:TextBox id="text" runat="server"/></td>
> </tr>
> </table>
> <p><center><input type="Submit" name="b1" value="Enter"></p>
> </form>
> </body>
> </head>
> </html>
>
>
>
>
> ADDRESS1.ASPX
>
> <%@ Import Namespace="System" %>
> <%@ Import Namespace="System.Data" %>
> <%@ Import Namespace="System.Data.ADO" %>
>
>
> <html>
>
> <script language="C#" runat="server" debug="true">
>
> string selfield = "";
> string seltext = "";
>
> void Page_Load(Object o, EventArgs e)
> {
> selfield = Request.Form["droplist"];
> seltext = Request.Form["text"];
>
> Response.Write(selfield);
> Response.Write(seltext);
> ADODataReader dr;
>
> String s= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source =
> D:/Lalitha/databases/AddressData.mdb ";
>
> ADOConnection connec = new ADOConnection(s);
> ADOCommand comm = new ADOCommand();
>
> comm.CommandType = CommandType.Text;
> comm.CommandText = "select * from address where FirstName =
> @seltext ";
> comm.ActiveConnection = connec;
>
> connec.Open();
>
> comm.Execute(out dr);
>
> while (dr.Read())
> {
> Response.Write(dr["FirstName"].ToString() + " ");
> Response.Write(dr["LastName"].ToString() + " ");
> Response.Write(dr["Email"].ToString() + " ");
> Response.Write("<br><br><br>");
> }
>
>
> }
> </script>
>
> </html>
>
>
> Thanks,
> Lata.
Message #5 by "Yu, Kevin" <kyu@N...> on Wed, 7 Nov 2001 12:13:22 -0500
|
|
go download the beta 2 of asp.net
-----Original Message-----
From: Lata Shah [mailto:lalithashank@h...]
Sent: Wednesday, November 07, 2001 9:59 AM
To: ASP+
Subject: [aspx] Re: Problem in accessing the data
When I include Import namespace System.Data.OleDb....., it gives an error
saying System.Data does not support. Why? Is it because I am using the
beta 1 version. If so how do I upgrade to beta 2? Kindly help.
> The WHERE clause does not seem to be working. Could anybody please help
me
> in debigging the code down below. I am pasting the code here:
>
> DISPLAY.ASPX
>
> <html>
> <title>ADDRESS DIARY</title>
> <head>
> <h1><center><u>Online Address Diary</u></center></h1>
> <body bgcolor="iceblue">
> <form method="POST" action="/aspnet/Projects/AddressDiary/address1.aspx"
> runat="server">
> <table>
> <tr>
> <td>Choose :</td>
> <td>
> <asp:DropDownList id="droplist" runat="server">
> <asp:ListItem>FirstName</asp:ListItem>
> <asp:ListItem>LastName</asp:ListItem>
> <asp:ListItem>City</asp:ListItem>
> <asp:ListItem>Country</asp:ListItem>
> </asp:DropDownList>
> </td>
> </tr>
> </table>
> <br><br><br><br>
> <table>
> <tr>
> <td>Enter here :</td>
> <td><asp:TextBox id="text" runat="server"/></td>
> </tr>
> </table>
> <p><center><input type="Submit" name="b1" value="Enter"></p>
> </form>
> </body>
> </head>
> </html>
>
>
>
>
> ADDRESS1.ASPX
>
> <%@ Import Namespace="System" %>
> <%@ Import Namespace="System.Data" %>
> <%@ Import Namespace="System.Data.ADO" %>
>
>
> <html>
>
> <script language="C#" runat="server" debug="true">
>
> string selfield = "";
> string seltext = "";
>
> void Page_Load(Object o, EventArgs e)
> {
> selfield = Request.Form["droplist"];
> seltext = Request.Form["text"];
>
> Response.Write(selfield);
> Response.Write(seltext);
> ADODataReader dr;
>
> String s= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source =
> D:/Lalitha/databases/AddressData.mdb ";
>
> ADOConnection connec = new ADOConnection(s);
> ADOCommand comm = new ADOCommand();
>
> comm.CommandType = CommandType.Text;
> comm.CommandText = "select * from address where FirstName =
> @seltext ";
> comm.ActiveConnection = connec;
>
> connec.Open();
>
> comm.Execute(out dr);
>
> while (dr.Read())
> {
> Response.Write(dr["FirstName"].ToString() + " ");
> Response.Write(dr["LastName"].ToString() + " ");
> Response.Write(dr["Email"].ToString() + " ");
> Response.Write("<br><br><br>");
> }
>
>
> }
> </script>
>
> </html>
>
>
> Thanks,
> Lata.
---
VBug Winter Conference 2001
Open Forum: Dan Appleman will be hosting an open
forum at The .NET Developer's Conference on
29th November 2001. The session will give
developers the chance to discuss and question
Dan on his experience with the .NET environment.
Dan has been programming Visual Basic since the
alpha version 1.0. And with over 10 years
Visual Basic experience is well qualified to
help you on your road to being a .NET Guru.
http://www.vbug.co.uk/redirect.asp?url=39&id=17
---
You are currently subscribed to
aspx as: kyu@n...
$subst('Email.Unsub')
Message #6 by "Lalitha Shankar" <lalithashank@h...> on Thu, 08 Nov 2001 06:26:30 +0400
|
|
<html><div style='background-color:'><DIV>
<P>When I include <FONT color=#ff0000><%@ Import Namespace="System.Data.OleDb" %>, it gives an error
saying <FONT face=Arial color=#000000>The type or namespace name 'OleDb' does not exist in the class or namespace
'System.Data'</FONT></FONT></P><FONT color=#ff0000><FONT face=Arial
color=#000000></FONT></FONT></DIV>
<P><FONT color=#ff0000>OR</FONT></P>
<P><FONT color=#ff0000>When I give the select statement as : comm.CommandText = "select * from address where FirstName =
' " + seltext " ' "; it gives an error saying (pointing to the select statement)--- <FONT face=Arial
color=#000000>An error occurred during the compilation of a resource required to service this request. Please review the specific
error details below and modify your source code appropriately. </FONT></FONT></P>
<P><FONT color=#ff0000><FONT face=Arial color=#000000>Kindly
help.</FONT><BR><BR></P></FONT>
<P><FONT color=#ff0000></FONT> </P>
<P><FONT color=#ff0000><FONT face=Arial color=#000000></FONT> </P>
<P><BR></P></FONT>
<P> </P>
<P> </P>
<P><BR><BR> </P>
<DIV></DIV>
<DIV></DIV>>From: "S. Asif Imam" <ASIFIMAM@Y...>
<DIV></DIV>>Reply-To: "ASP+" <ASPX@P...>
<DIV></DIV>>To: "ASP+" <ASPX@P...>
<DIV></DIV>>Subject: [aspx] Re: Problem in accessing the data
<DIV></DIV>>Date: Wed, 7 Nov 2001 19:03:22 +0500
<DIV></DIV>>
<DIV></DIV>> > comm.CommandText = "select * from address where FirstName =
<DIV></DIV>> > @seltext ";
<DIV></DIV>>--> @seltext "; this indicate a command parameter
<DIV></DIV>>correct will be either *******(using System.Data.OleDb;)*****
<DIV></DIV>>
<DIV></DIV>>comm.CommandText = "select * from address where FirstName = @seltext ";
<DIV></DIV>>comm.Parameters.Add (new OleDbParameter("@seltext", OleDbType.VarChar));
<DIV></DIV>>comm.Parameters["@seltext"].Value = seltext;
<DIV></DIV>>
<DIV></DIV>>OR
<DIV></DIV>>Directly specify the value in string like ..
<DIV></DIV>>
<DIV></DIV>>comm.CommandText = "select * from address where FirstName = ' " + seltext "'
<DIV></DIV>>" ; //dont miss the single quotes..
<DIV></DIV>>
<DIV></DIV>>let me know if it problem persists.
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>----- Original Message -----
<DIV></DIV>>From: "Lata Shah" <LALITHASHANK@H...>
<DIV></DIV>>To: "ASP+" <ASPX@P...>
<DIV></DIV>>Sent: Wednesday, November 07, 2001 11:15 AM
<DIV></DIV>>Subject: [aspx] Problem in accessing the data
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>> > The WHERE clause does not seem to be working. Could anybody please help me
<DIV></DIV>> > in debigging the code down below. I am pasting the code here:
<DIV></DIV>> >
<DIV></DIV>> > DISPLAY.ASPX
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> >
<H1>
<CENTER><U>Online Address Diary</U></CENTER></H1>
<DIV></DIV>> >
<DIV></DIV>> >
<FORM action=/aspnet/Projects/AddressDiary/address1.aspx method=post DIV <>> > runat="server">
<DIV></DIV>> >
<TABLE>
<DIV></DIV>> >
<TBODY>
<TR>
<DIV></DIV>> >
<TD>Choose :</TD>
<DIV></DIV>> >
<TD>
<DIV></DIV>> > <?xml:namespace prefix = asp /><asp:DropDownList id=droplist runat="server">
<DIV></DIV>> > <asp:ListItem>FirstName</asp:ListItem>
<DIV></DIV>> > <asp:ListItem>LastName</asp:ListItem>
<DIV></DIV>> > <asp:ListItem>City</asp:ListItem>
<DIV></DIV>> > <asp:ListItem>Country</asp:ListItem>
<DIV></DIV>> > </asp:DropDownList>
<DIV></DIV>> > </TD>
<DIV></DIV>> > </TR>
<DIV></DIV>> > </TBODY></TABLE>
<DIV></DIV>> > <BR><BR><BR><BR>
<DIV></DIV>> >
<TABLE>
<DIV></DIV>> >
<TBODY>
<TR>
<DIV></DIV>> >
<TD>Enter here :</TD>
<DIV></DIV>> >
<TD><asp:TextBox id=text runat="server"></asp:TextBox></TD>
<DIV></DIV>> > </TR>
<DIV></DIV>> > </TBODY></TABLE>
<DIV></DIV>> >
<P>
<CENTER><INPUT type=submit value=Enter name=b1>
<P></P>
<DIV></DIV>> > </FORM>
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> > ADDRESS1.ASPX
<DIV></DIV>> >
<DIV></DIV>> > <%@ Import Namespace="System" %>
<DIV></DIV>> > <%@ Import Namespace="System.Data" %>
<DIV></DIV>> > <%@ Import Namespace="System.Data.ADO" %>
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> >
<SCRIPT language=C# runat="server" debug="true">
</DIV>> >
</DIV>> > string selfield = "";
</DIV>> > string seltext = "";
</DIV>> >
</DIV>> > void Page_Load(Object o, EventArgs e)
</DIV>> > {
</DIV>> > selfield = Request.Form["droplist"];
</DIV>> > seltext = Request.Form["text"];
</DIV>> >
</DIV>> > Response.Write(selfield);
</DIV>> > Response.Write(seltext);
</DIV>> > ADODataReader dr;
</DIV>> >
</DIV>> > String s= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source
</DIV>> > D:/Lalitha/databases/AddressData.mdb ";
</DIV>> >
</DIV>> > ADOConnection connec = new ADOConnection(s);
</DIV>> > ADOCommand comm = new ADOCommand();
</DIV>> >
</DIV>> > comm.CommandType = CommandType.Text;
</DIV>> > comm.CommandText = "select * from address where FirstName
</DIV>> > @seltext ";
</DIV>> > comm.ActiveConnection = connec;
</DIV>> >
</DIV>> > connec.Open();
</DIV>> >
</DIV>> > comm.Execute(out dr);
</DIV>> >
</DIV>> > while (dr.Read())
</DIV>> > {
</DIV>> > Response.Write(dr["FirstName"].ToString() + " ");
</DIV>> > Response.Write(dr["LastName"].ToString() + " ");
</DIV>> > Response.Write(dr["Email"].ToString() + " ");
</DIV>> > Response.Write("<br><br><br>");
</DIV>> > }
</DIV>> >
</DIV>> >
</DIV>> > }
</DIV>> > </SCRIPT>
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> > Thanks,
<DIV></DIV>> > Lata.
<DIV></DIV>> >
<DIV></DIV>> > ---
<DIV></DIV>> > VBug Winter Conference 2001
<DIV></DIV>> >
<DIV></DIV>> > Open Forum: Dan Appleman will be hosting an open
<DIV></DIV>> > forum at The .NET Developer's Conference on
<DIV></DIV>> > 29th November 2001. The session will give
<DIV></DIV>> > developers the chance to discuss and question
<DIV></DIV>> > Dan on his experience with the .NET environment.
<DIV></DIV>> > Dan has been programming Visual Basic since the
<DIV></DIV>> > alpha version 1.0. And with over 10 years
<DIV></DIV>> > Visual Basic experience is well qualified to
<DIV></DIV>> > help you on your road to being a .NET Guru.
<DIV></DIV>> >
<DIV></DIV>> > http://www.vbug.co.uk/redirect.asp?url=39&id=17
<DIV></DIV>> >
<DIV></DIV>> > ---
<DIV></DIV>> > You are currently subscribed to
<DIV></DIV>> > aspx as: asifimam@y...
<DIV></DIV>> >
<DIV></DIV>> > $subst('Email.Unsub')
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>---
<DIV></DIV>>VBug Winter Conference 2001
<DIV></DIV>>
<DIV></DIV>>Open Forum: Dan Appleman will be hosting an open
<DIV></DIV>>forum at The .NET Developer's Conference on
<DIV></DIV>>29th November 2001. The session will give
<DIV></DIV>>developers the chance to discuss and question
<DIV></DIV>>Dan on his experience with the .NET environment.
<DIV></DIV>>Dan has been programming Visual Basic since the
<DIV></DIV>>alpha version 1.0. And with over 10 years
<DIV></DIV>>Visual Basic experience is well qualified to
<DIV></DIV>>help you on your road to being a .NET Guru.
<DIV></DIV>>
<DIV></DIV>>http://www.vbug.co.uk/redirect.asp?url=39&id=17
<DIV></DIV>>
<DIV></DIV>>---
<DIV></DIV>>You are currently subscribed to
<DIV></DIV>>aspx as: lalithashank@h...
<DIV></DIV>>
<DIV></DIV>>$subst('Email.Unsub')
<DIV></DIV></CENTER></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a
href='http://go.msn.com/bql/hmtag_itl_EN.asp'>http://explorer.msn.com</a><br></html>
Message #7 by "S. Asif Imam" <asifimam@y...> on Thu, 8 Nov 2001 11:58:02 +0500
|
|
Please use these two files ..
Tested on Beta 2.. Beta one is not recommended to use as, good difference is
there, and you have to learn again to acomodate your self in Beta2.
/***************************************************************************
*/
Display.aspx
/***************************************************************************
*/
<%@ Page %>
<html>
<head>
<title>ADDRESS DIARY</title>
</head>
<body bgcolor="#0cb0e0">
<P align="center">
<u><STRONG><FONT size="6">Online Address Diary</FONT></STRONG></u>
</P>
<form name="myform" action="Address1.aspx" method="post">
<table>
<tr>
<td>
Choose :
</td>
<td>
<asp:DropDownList id="droplist" runat="server">
<asp:ListItem>FirstName</asp:ListItem>
<asp:ListItem>LastName</asp:ListItem>
<asp:ListItem>City</asp:ListItem>
<asp:ListItem>Country</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
<br>
<table>
<tr>
<td>
Enter here :
</td>
<td>
<asp:TextBox id="text" runat="server" />
</td>
</tr>
</table>
<br>
<input type="submit" value=" Enter " runat="server">
</form>
</body>
</html>
/***************************************************************************
*/
/***************************************************************************
*/
Address1.aspx
/***************************************************************************
*/
<%@ Page %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<HTML>
<TITLE>Search Results</TITLE>
<script language="C#" runat="server">
void Page_Load(Object o, EventArgs e)
{
string selfield = "";
string seltext = "";
selfield = Request.Form["droplist"];
seltext = Request.Form["text"];
Response.Write("<b>Search against...</b><br>");
Response.Write("Field : " + selfield +"<br>");
Response.Write("Value : " + seltext + "<br>");
Response.Write("<b>Search Results...</b><br>" );
OleDbDataReader dr;
String s= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source
D:/Lalitah/Databases/Addressdata.mdb ";
OleDbConnection connec = new OleDbConnection(s);
OleDbCommand comm = new OleDbCommand();
comm.CommandType = CommandType.Text;
comm.CommandText = "select * from address where " + selfield +" = '"+
seltext +"'";
comm.Connection = connec;
connec.Open();
dr = comm.ExecuteReader();
while (dr.Read()){
Response.Write(" <b>First Name:</b> " +
dr["FirstName"].ToString() + " ");
Response.Write("<br>");
Response.Write(" <b>Last Name: </b>" +
dr["LastName"].ToString() + " ");
Response.Write("<br>");
Response.Write(" <b>Email: </b>" +
dr["Email"].ToString() + " ");
Response.Write("<br>");
Response.Write("<b>****************************************************</b>"
);
Response.Write("<br><br>");
}
dr.Close();
}
</script>
<body bgColor="#99ccff" text="navy">
</body>
</HTML>
/***************************************************************************
*/
|
|
 |