Click here to Skip to main content
15,902,447 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHow to export arabic data to csv? Pin
Athul from Sharjah16-May-10 3:17
Athul from Sharjah16-May-10 3:17 
AnswerRe: How to export arabic data to csv? Pin
sweet_light7-Sep-10 0:17
sweet_light7-Sep-10 0:17 
QuestionRoleManager issues with SharePoint FBA Pin
BaggyG16-May-10 2:02
BaggyG16-May-10 2:02 
Questionwhere to give image url to display image [modified] Pin
developerit15-May-10 21:06
developerit15-May-10 21:06 
AnswerRe: where to give image url to display image Pin
Not Active16-May-10 2:31
mentorNot Active16-May-10 2:31 
AnswerRe: where to give image url to display image Pin
michaelschmitt17-May-10 0:09
michaelschmitt17-May-10 0:09 
QuestionDatabase Error when retrieving specific records from a table Pin
Eagle3215-May-10 11:26
Eagle3215-May-10 11:26 
AnswerRe: Database Error when retrieving specific records from a table Pin
Tarakeshwar Reddy15-May-10 12:41
professionalTarakeshwar Reddy15-May-10 12:41 
The problem is because you are not setting the parameter value. Also, you need to use the ? and not a named parameter @ThreadID in the query.

public DataSet RetrieveComments(int threadID)
{
   String connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|/MyDatabase.mdb;Persist Security Info=True";
   OleDbConnection dbConn = new OleDbConnection(connString);

   String queryString = "SELECT * FROM [Comments] WHERE [ThreadID] = ?";
   OleDbCommand oleDbCommand = new OleDbCommand(queryString, dbConn);
   oleDbCommand.Parameters.Add("@threadID", OleDbType.Integer, 10).Value = threadID;

   OleDbDataAdapter dbAdapter = new OleDbDataAdapter();
   dbAdapter.SelectCommand = oleDbCommand;
   dbConn.Open();

   DataSet dataSet = new DataSet();
   dbAdapter.Fill(dataSet, "Comments");

   dbConn.Close();
   return dataSet;
}


Make sure the parameters and syntax are okay. Also use the using statement to make sure your objects get disposed properly.
AnswerRe: Database Error when retrieving specific records from a table Pin
hyjiacan15-May-10 14:27
hyjiacan15-May-10 14:27 
GeneralRe: Database Error when retrieving specific records from a table Pin
Tarakeshwar Reddy15-May-10 17:20
professionalTarakeshwar Reddy15-May-10 17:20 
QuestionError trying to set the style sheet in the code behind. Pin
Steve Holdorf15-May-10 9:45
Steve Holdorf15-May-10 9:45 
AnswerRe: Error trying to set the style sheet in the code behind. Pin
Not Active15-May-10 17:23
mentorNot Active15-May-10 17:23 
QuestionWeb Server serving as a TCP/IP communication server as well Pin
Stevo Z15-May-10 4:58
Stevo Z15-May-10 4:58 
AnswerRe: Web Server serving as a TCP/IP communication server as well Pin
DeepToot18-May-10 8:39
DeepToot18-May-10 8:39 
GeneralRe: Web Server serving as a TCP/IP communication server as well Pin
Stevo Z18-May-10 11:05
Stevo Z18-May-10 11:05 
Questiondata problem Pin
bapu288915-May-10 0:58
bapu288915-May-10 0:58 
AnswerRe: data problem Pin
Not Active15-May-10 3:03
mentorNot Active15-May-10 3:03 
QuestionRe: data problem Pin
bapu288915-May-10 6:59
bapu288915-May-10 6:59 
AnswerRe: data problem Pin
Not Active15-May-10 7:24
mentorNot Active15-May-10 7:24 
GeneralRe: data problem Pin
bapu288915-May-10 7:43
bapu288915-May-10 7:43 
QuestionMaster-Content Page postback issues Pin
trunkwala_abbas15-May-10 0:07
trunkwala_abbas15-May-10 0:07 
AnswerRe: Master-Content Page postback issues Pin
Not Active15-May-10 3:05
mentorNot Active15-May-10 3:05 
QuestionEvents are not firing Pin
4anusha414-May-10 20:41
4anusha414-May-10 20:41 
AnswerRe: Events are not firing Pin
janani1316-May-10 17:22
janani1316-May-10 17:22 
QuestionAlternate to Shopping Cart? Pin
thatraja14-May-10 20:03
professionalthatraja14-May-10 20:03 

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.