| | |
database problem
Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Thread Solved
![]() |
•
•
Join Date: Nov 2008
Posts: 27
Reputation:
Solved Threads: 0
mydb thedb = new mydb();
MyGlobal oapp = new MyGlobal();
//define the reader
System.Data.OleDb.OleDbDataReader theReader = null;
//defining sql
string _sql = "SELECT * FROM searchtest WHERE ID = " + _ddsearch;
string _sqlupdate = "";
//execute the reader
theReader = thedb.SQLExecute_Reader(_sql);this code is try to grab the value from _ddsearch variable
if the value is number it works
but if it is string, theReader return null
this is the problem
string _sql = "SELECT * FROM searchtest WHERE ID = " + _ddsearch; the code above is for number
how do you make
ID = " + _ddsearch; to get variable value as stringI try to put another qutation mark but it is still wrong
Is ID a string?
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Similar Threads
- Retrieve Information from Database & Display into ASP.NET Web Controls Textbox (ASP.NET)
- database problem (C#)
- picture saving in database. problem (Visual Basic 4 / 5 / 6)
- problem in Start time and end time reservation (JSP)
- Error connecting to database (ASP.NET)
- database access is getting slow day by day (MySQL)
- Problem printing from IE6 (Web Browsers)
Other Threads in the C# Forum
- Previous Thread: binding list box URGENT!!!!
- Next Thread: file path name
| Thread Tools | Search this Thread |
.net access algorithm angle array asp.net bitmap box broadcast c# capturing check checkbox client combobox control conversion csharp database databasesearch datagrid datagridview dataset datetime dbconnection degrees delegate design development disappear draganddrop drawing encryption enum eventhandlers excel file firefox form format forms function gdi+ grantorrevokepermissionthroughc#.net image input install interface java libraries list loop marshalbyrefobject math monodevelop mouseclick movingimage msword mysql operator path pause photoshop php picturebox pixelinversion platform post programming radians regex remoting richtextbox server sleep socket sql statistics string study system.servicemodel table tcpclientchannel text textbox thread time timer update usb usercontrol validation virtualization visualbasic visualstudio webbrowser winforms wpf wpfc# xml







