Hey,
Please try to change the query for getting single column
as
select count(*) from tbl_login..
instead of
select * from tbl_login where ...
Thanks,
Aruna.
On Mon, Sep 5, 2011 at 8:35 PM, praveen singh <[email protected]> wrote:
> My code is in root Web Config directory is:-
> *<authentication mode="Forms">
> <forms loginUrl="MSAcess.aspx" defaultUrl="~/admin/home.aspx" />
> </authentication>*
> and sub folder is:-
> *<authorization>
> <deny users="?"/>
> </authorization>
>
> *now my code in code behind file is:-
>
> * ocn1.Open();
> cmd = new OleDbCommand("select * from tbl_login where UseName='"
> +txt_Username.Text + "' and Password='" +txt_Password.Text + "'", ocn1);
> int count = Convert.ToInt16(cmd.ExecuteScalar());
> if (count > 0)
> {
> Response.Redirect("~/admin/home.aspx");
> }
> else
> {
> lbl_error.Text = "Login Failed!";
> }
> *where I go wrong please tell
>
> --
> You received this message because you are subscribed to the Google
> Groups "DotNetDevelopment, VB.NET <http://vb.net/>, C# .NET,
> ADO.NET<http://ado.net/>,
> ASP.NET <http://asp.net/>, XML, XML
> Web Services,.NET Remoting" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
> or visit the group website at http://megasolutions.net
>
--
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net