Access and ASP.Net
-
Hi, I'm using MS Access 2003 database with c#.net 2003. Now I've a comobo, in which department name are shown and onchangeindex i use to get department code, show i textbox. Now the problem is this when i add department no 11 in the database, my comobox stop working and i got javascript error: Error:Invaild Syntax in statusbar. Kindly help where i made a mistake ( In web code or database) I use normal database settings. Thanks
|Muhamad Waqas Butt| waqasb4all@yahoo.com www.sktech.freewebspace.com
-
Hi, I'm using MS Access 2003 database with c#.net 2003. Now I've a comobo, in which department name are shown and onchangeindex i use to get department code, show i textbox. Now the problem is this when i add department no 11 in the database, my comobox stop working and i got javascript error: Error:Invaild Syntax in statusbar. Kindly help where i made a mistake ( In web code or database) I use normal database settings. Thanks
|Muhamad Waqas Butt| waqasb4all@yahoo.com www.sktech.freewebspace.com
Please post your code or run your application with the Break point and try to locate in which line the error shows. We are not magic man without seeing the code how can we tell where the error is.
Regards, Satips.:rose:
-
Please post your code or run your application with the Break point and try to locate in which line the error shows. We are not magic man without seeing the code how can we tell where the error is.
Regards, Satips.:rose:
Here is a code: try { string cmdstr="SELECT * FROM tablename where dp_head='"+ dpdhead.SelectedValue +"'"; con=new OleDbConnection(cons); cmd=new OleDbCommand(cmdstr,con); con.Open(); OleDbDataReader dr = cmd.ExecuteReader(); bool chkrec = dr.Read(); if(chkrec == true) { string dasv = dr.GetInt32(0).ToString(); txtacno.Text = dasv; } // Output '/LM/w3svc/1/root/expdemo-5-128280938191702288': Loaded 'c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\expdemo\280c9982\bd477ac7\gottf48d.dll', Symbols loaded. // Now
|Muhamad Waqas Butt| waqasb4all@yahoo.com www.sktech.freewebspace.com
-
Here is a code: try { string cmdstr="SELECT * FROM tablename where dp_head='"+ dpdhead.SelectedValue +"'"; con=new OleDbConnection(cons); cmd=new OleDbCommand(cmdstr,con); con.Open(); OleDbDataReader dr = cmd.ExecuteReader(); bool chkrec = dr.Read(); if(chkrec == true) { string dasv = dr.GetInt32(0).ToString(); txtacno.Text = dasv; } // Output '/LM/w3svc/1/root/expdemo-5-128280938191702288': Loaded 'c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\expdemo\280c9982\bd477ac7\gottf48d.dll', Symbols loaded. // Now
|Muhamad Waqas Butt| waqasb4all@yahoo.com www.sktech.freewebspace.com
You may be better off by using a Parameter List for your OleDBCommand Object. replace your appropriate lines: string cmdstr = "SELECT * FROM Tablename where field = @fieldvalue;"; cmd = new OleDBCommand(cmdstr,con); cmd.Parameters.AddWithParameter("@fieldvalue",dpdhead.SelectedValue); Parameter Lists help organization And is another obstacle for Hackers. Also look to this: string dasv = dr[0].ToString();