Click here to Skip to main content
15,889,805 members
Home / Discussions / C#
   

C#

 
QuestionRe: Suggestions on how to model a simple validation program Pin
neualex26-Aug-09 17:49
neualex26-Aug-09 17:49 
AnswerRe: Suggestions on how to model a simple validation program Pin
N a v a n e e t h26-Aug-09 18:25
N a v a n e e t h26-Aug-09 18:25 
QuestionRe: Suggestions on how to model a simple validation program Pin
neualex27-Aug-09 1:56
neualex27-Aug-09 1:56 
AnswerRe: Suggestions on how to model a simple validation program Pin
N a v a n e e t h27-Aug-09 2:23
N a v a n e e t h27-Aug-09 2:23 
GeneralRe: Suggestions on how to model a simple validation program Pin
neualex27-Aug-09 2:30
neualex27-Aug-09 2:30 
Questionproblem with data table Pin
myinstincts26-Aug-09 2:39
myinstincts26-Aug-09 2:39 
AnswerRe: problem with data table Pin
baranils26-Aug-09 4:47
baranils26-Aug-09 4:47 
Questionsyntax error...plz help me Pin
ankitjain111026-Aug-09 2:02
ankitjain111026-Aug-09 2:02 
Server Error in '/WebSite1' Application.
--------------------------------------------------------------------------------

Syntax error (missing operator) in query expression 'DOCTOR NAME = 'ankit''.
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.Data.OleDb.OleDbException: Syntax error (missing operator) in query expression 'DOCTOR NAME = 'ankit''.

Source Error:


Line 175: OleDbCommand cmd4 = new OleDbCommand(query,con1);
Line 176: //cmd4.ExecuteNonQuery
Line 177: dr = cmd4.ExecuteReader();
Line 178: if (dr.Read())
Line 179: {


Source File: c:\Users\Ankit\Documents\Visual Studio 2005\WebSites\WebSite1\Default2.aspx.cs Line: 177

my code is

tring connection1 = ConfigurationManager.AppSettings["conn"];
OleDbConnection con1 = new OleDbConnection(connection1);
con1.Open();
OleDbDataAdapter da = new OleDbDataAdapter();
DataSet ds = new DataSet();


OleDbDataReader dr;
string query="select COUNT(*) from appointment where DOCTOR NAME = '" + DropDownList1.SelectedItem + "' ";

OleDbCommand cmd4 = new OleDbCommand(query,con1);
//cmd4.ExecuteNonQuery
dr = cmd4.ExecuteReader();
if (dr.Read())
{
//if (Convert.ToInt16(dr[0]) != 4)
TextBox3.Text = "hello";
TextBox3.Text = dr[0].ToString();
}
AnswerRe: syntax error...please help me Pin
Tony Richards26-Aug-09 2:14
Tony Richards26-Aug-09 2:14 
GeneralRe: syntax error...please help me Pin
ankitjain111026-Aug-09 2:22
ankitjain111026-Aug-09 2:22 
AnswerSame question Pin
Not Active26-Aug-09 2:15
mentorNot Active26-Aug-09 2:15 
GeneralRe: Same question Pin
Tony Richards26-Aug-09 2:18
Tony Richards26-Aug-09 2:18 
QuestionDisplay DataGridView Dynamically Pin
Ankit At Codeproject26-Aug-09 1:44
Ankit At Codeproject26-Aug-09 1:44 
AnswerRe: Display DataGridView Dynamically Pin
stancrm26-Aug-09 1:51
stancrm26-Aug-09 1:51 
QuestionListView Context Menu Pin
kanchoette26-Aug-09 1:43
kanchoette26-Aug-09 1:43 
AnswerRe: ListView Context Menu Pin
stancrm26-Aug-09 1:48
stancrm26-Aug-09 1:48 
GeneralRe: ListView Context Menu Pin
kanchoette26-Aug-09 1:49
kanchoette26-Aug-09 1:49 
QuestionProblem in connecting with SQL database on client machine Pin
Affan Toor26-Aug-09 1:29
Affan Toor26-Aug-09 1:29 
AnswerRe: Problem in connecting with SQL database on client machine Pin
Henry Minute26-Aug-09 3:48
Henry Minute26-Aug-09 3:48 
GeneralRe: Problem in connecting with SQL database on client machine Pin
Affan Toor26-Aug-09 21:39
Affan Toor26-Aug-09 21:39 
GeneralRe: Problem in connecting with SQL database on client machine Pin
Henry Minute27-Aug-09 0:04
Henry Minute27-Aug-09 0:04 
Questiongettin some error @ run time Pin
ankitjain111026-Aug-09 0:20
ankitjain111026-Aug-09 0:20 
AnswerRe: gettin some error @ run time Pin
Luc Pattyn26-Aug-09 0:29
sitebuilderLuc Pattyn26-Aug-09 0:29 
GeneralRe: gettin some error @ run time Pin
ankitjain111026-Aug-09 0:32
ankitjain111026-Aug-09 0:32 
GeneralRe: gettin some error @ run time Pin
Luc Pattyn26-Aug-09 0:35
sitebuilderLuc Pattyn26-Aug-09 0:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.