| | |
database problem
Please support our C# advertiser: Intel Parallel Studio Home
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 array barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom cyclethruopenforms data database datagrid datagridview dataset date/time datetime degrees development dll draganddrop drawing encryption enum event excel file finalyearproject form format forms function gdi+ getoutlookcontactusinfcsvfile globalization httpwebrequest image index input install installer java label list listbox mandelbrot math mono mouseclick mysql operator panel path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox save server silverlight sleep socket sql sql-server statistics stream string table text textbox thread time timer timespan update usercontrol users validate validation visualstudio webbrowser wia windows winforms wpf xml







