C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Data type mismatch in criteria expression.


Posted Date: 04 Nov 2009      Posted By: net      Member Level: Silver     Points: 1   Responses: 1



hi,
i am doing project in asp.net with c# in windows applications with backend ms access,
i am select the values for this i am using this class file:

public OleDbDataReader GetDataBase(string Commt)
{
try
{

OleDbConnection ConnObj = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\\Finance.mdb");
OleDbCommand Commtobj = new OleDbCommand(Commt, ConnObj);
if (ConnObj.State == ConnectionState.Closed)
{
ConnObj.Open();
}
OleDbDataReader Reader = Commtobj.ExecuteReader();
return Reader;
}
catch (OleDbException ex)
{

throw ex;

}

}

my coding:

string s1 = "Select AccountNo,UserName from LendersInformation where AccountNo='" + dd_userid.Text + "'";
OleDbDataReader dr = con.GetDataBase(s1);
while (dr.Read())
{
lbl_username.Text = dr[1].ToString();

}
dr.Close();
my error:
Data type mismatch in criteria expression.






Responses

Author: Nikhil Gaur    04 Nov 2009Member Level: DiamondRating: 3 out of 53 out of 53 out of 5     Points: 3

please check that GetDatabase returns Datareder objects or not. Because this cause a problem is it doesn't return reader object.

Join this campus group
http://www.dotnetspider.com/sites/637/-ecb-aspdotnet.aspx

Thanks & Regards
NIks
My Software and Web Development Experience



Post Reply
You must Sign In to post a response.
Next : Grid Paging Problem
Previous : Download
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use