473,325 Members | 2,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Error in Validating the LoginPage

Expand|Select|Wrap|Line Numbers
  1. namespace VendorProjNew
  2. {
  3.     public partial class frmLogIn : System.Web.UI.Page
  4.     {
  5.  
  6.         protected void Page_Load(object sender, EventArgs e)
  7.         {
  8.  
  9.         }
  10.  
  11.         string str = System.Configuration.ConfigurationManager.ConnectionStrings["VendorNewConnectionString"].ConnectionString;
  12.  
  13.         protected void btnSubmit_Click1(object sender, EventArgs e)
  14.         {
  15.  
  16.             // to validate some field 
  17.  
  18.             if (this.Page.IsValid)
  19.             {
  20.                 SqlConnection Objcon = new SqlConnection(str);
  21.                 // to store the data 
  22.                 DataTable dt = new DataTable();
  23.                 // opening the connection
  24.                 Objcon.Open();
  25.                 // passing the Sp name and the conn name
  26.                 SqlCommand oCmd = new SqlCommand("SP_Login_validate", Objcon);
  27.                 oCmd.CommandType = CommandType.StoredProcedure;
  28.                 oCmd.Parameters.AddWithValue("@vname", txtVendorName.Text);
  29.                 oCmd.Parameters.AddWithValue("@pwd", txtPasssword.Text);
  30.                 // to get details through database is accessed using data adapter
  31.                 SqlDataAdapter da = new SqlDataAdapter(oCmd);
  32.                 da.Fill(dt);
  33.                 oCmd.ExecuteNonQuery(); 
  34.                 Objcon.Close();
  35.                 Response.Redirect("VendorDetails.aspx");
  36.             }
  37.  
  38.         }
  39.  
  40.     }
  41. }
  42.  
StoredProcedure:
create procedure SP_Login_validate
@pwd nvarchar(20),
@vname nvarchar(50)
as
begin
SELECT [Password]
,[VendorName]
FROM [VendorNew].[dbo].[Login] where Password=@pwd and VendorName =@vname
end
Apr 23 '12 #1
1 1424
Rabbit
12,516 Expert Mod 8TB
You didn't say what the error is.
Apr 23 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: DeMZed | last post by:
Hi, When validating my web site, I've got the following error : ------------------------------ Line 31, column 26: cannot generate system identifier for general entity "PHPSESSID" <a...
0
by: Adam Smith | last post by:
Hello. I've got a total of 5 schemas. They are: 1 - 1.xsd - a description of a city 2 - 2.xsd - a description of a town 3 - CityHall.xsd - a description of a cityhall-meant to be part of a...
1
by: Craig Beuker | last post by:
Hello, I am experimenting with this XmlValidatingReader and have a question about how it is working (or not working as would be the case) The sample documents and code are included at the end...
0
by: James Zhuo | last post by:
hi all I changed the name of the class LoginPage to a different name "LoginPageOne" But the same error gets generated with the Wiliam.Request.LoginPageOne. That pretty much leaves me clueless...
2
by: francois | last post by:
in my web.config i have the following : <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
1
by: Cesar | last post by:
Hello, I've developed a .NET C# web service; which has one method named, let's say, upload_your_data. This method has one parameter ( string your_data). The value that this parameter will...
4
by: easoftware | last post by:
I am using VS .Net 2003 and VB. I have an app with one parent and two Mdi child forms. I need to validate data in the Mdi form. The Form.Validating event works when I try to close a Mdi form,...
1
by: gau.tai | last post by:
I have a form in which I am generating dynamic fields. I can do this fine, but when I go to validate them there are errors. The non- dynamic fields validate correctly. Below is the html and js. ...
0
by: Subanesh | last post by:
Hi All, Am new to using HTMLUnit.I wrote a sample code(to emulate opening of website google.com and enter a value say "html" in the text field and click the Search button) .The code is as follows...
2
by: FutureShock | last post by:
I am using a registration class to process a registration form and need some opinions on returning error messages. I am self referring the page on submit. I would like to send each form field...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.