Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Value cannot be null.
Parameter name: dataSet
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: dataSet

Source Error:


Line 672:        da.Fill(ds,"cv");<br />
Line 673:        da1=new OleDbDataAdapter(sql,con);<br />
Line 674:        da1.Fill(ds1,"cv");<br />
Line 675:		int r=0,r1=0;<br />
Line 676:		DataRow []rs;



My code is given below


C#
s1 = TextBox1.Text.Trim();
        s2 = TextBox2.Text.Trim();
      
        con.Open();
       	string sql = "select * from cv";
       // string sql1 = "select * from cv";
        da=new OleDbDataAdapter(sql,con);
        da.Fill(ds,"cv");
        da1=new OleDbDataAdapter(sql,con);
        da1.Fill(ds1,"cv");
		int r=0,r1=0;
		DataRow []rs;
		DataRow []rs1;
		rs=ds.Tables["cv"].Select("email='" + s1 + "'");
		r=rs.Length;
		rs1=ds1.Tables["cv"].Select("pass='" + s2 + "'");
		r1=rs1.Length;
		   try {       
            if (s1 == "" && s2 == "")
			{
                Label1.Text = "Please enter your Email ID and Password";
			}
            else 
			{
			if (r>0)
			{
			if(r1>0)
			{
                Response.Redirect("account.aspx");
			}
			else
			{
                Label1.Text = "Email ID not registred or Check your Password";
			}
			}
			}
			}
			catch (Exception ex)
			{
			Response.Write(ex.Message);
			}
          con.Close();
Posted
Updated 7-Dec-11 21:10pm
v2
Comments
Timberbird 8-Dec-11 3:15am    
You didn't show the most interesting part: how ds and ds1 are defined and which values are assigned to them :)
OriginalGriff 8-Dec-11 3:18am    
If you are going to paste code, please make sure it is indented properly! It is remarkably hard to read like that...
Use the "Improve question" widget to edit your question and provide better information.
Programm3r 8-Dec-11 3:19am    
Okay, but isn't it obvious that the dataset is null, thus check why the dataset is null?!?

1 solution

I believe it is the con which is supposed to be your connection string is null. Make sure that connection string is not null and must be valid.

Regards,
Eduard
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900