Click here to Skip to main content
15,909,030 members
Home / Discussions / C#
   

C#

 
QuestionOleDbDataReader error Pin
julyhaluna3-Nov-09 20:46
julyhaluna3-Nov-09 20:46 
conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data source= C:/data.accdb;User Id=admin;Password=";
string sql = "SELECT UserName, UserPassword FROM TblUsers";
OleDbCommand cmd = new OleDbCommand(sql, conn);
OleDbDataReader dbReader = cmd.ExecuteReader();

            dbReader = cmd.ExecuteReader();
            
            while (dbReader.Read())
            {
                UserName = dbReader.GetString(3).ToString();
                PassWord = dbReader.GetString(4).ToString();
            }
            
            dbReader.Close();
conn.Close();


i have an error in the Data Reader. the error lies in,OleDbDataReader dbReader = cmd.ExecuteReader(); adn it say it has no value given for one or more parameters. I have ask my friends and they say the problem is the,string sql = "SELECT UserName, UserPassword FROM TblUsers";

so now i know that the problem lies in the string sql.
but i do not know what to change in the string.

can anyone help?? :S
i will really appreciate it! thank you.
AnswerRe: OleDbDataReader error Pin
dan!sh 3-Nov-09 20:57
professional dan!sh 3-Nov-09 20:57 
AnswerRe: OleDbDataReader error Pin
Christian Graus3-Nov-09 21:11
protectorChristian Graus3-Nov-09 21:11 
AnswerRe: OleDbDataReader error Pin
Luc Pattyn3-Nov-09 23:24
sitebuilderLuc Pattyn3-Nov-09 23:24 
QuestionAdd Image in Picture box Pin
Matsyendra3-Nov-09 20:34
Matsyendra3-Nov-09 20:34 
AnswerRe: Add Image in Picture box Pin
dan!sh 3-Nov-09 20:45
professional dan!sh 3-Nov-09 20:45 
GeneralRe: Add Image in Picture box Pin
Matsyendra3-Nov-09 21:03
Matsyendra3-Nov-09 21:03 
GeneralRe: Add Image in Picture box Pin
Christian Graus3-Nov-09 21:10
protectorChristian Graus3-Nov-09 21:10 
GeneralRe: Add Image in Picture box Pin
dan!sh 3-Nov-09 21:23
professional dan!sh 3-Nov-09 21:23 
GeneralRe: Add Image in Picture box Pin
LHP02103-Nov-09 21:04
LHP02103-Nov-09 21:04 
GeneralRe: Add Image in Picture box Pin
dan!sh 3-Nov-09 21:07
professional dan!sh 3-Nov-09 21:07 
AnswerRe: Add Image in Picture box Pin
Luc Pattyn3-Nov-09 23:27
sitebuilderLuc Pattyn3-Nov-09 23:27 
QuestionMerge Word documents into one file Pin
@nisha 2n3-Nov-09 20:27
@nisha 2n3-Nov-09 20:27 
AnswerRe: Merge Word documents into one file Pin
Christian Graus3-Nov-09 21:08
protectorChristian Graus3-Nov-09 21:08 
Questionhi.. Pin
mjawadkhatri3-Nov-09 19:23
mjawadkhatri3-Nov-09 19:23 
AnswerRe: hi.. Pin
Christian Graus3-Nov-09 19:40
protectorChristian Graus3-Nov-09 19:40 
AnswerRe: hi.. Pin
King Julien3-Nov-09 20:16
King Julien3-Nov-09 20:16 
QuestionC# function(out byte buffer, ..) and its ActiveX module in C++ function(unsigned char* buffer, ... Pin
Chesnokov Yuriy3-Nov-09 19:17
professionalChesnokov Yuriy3-Nov-09 19:17 
AnswerRe: C# function(out byte buffer, ..) and its ActiveX module in C++ function(unsigned char* buffer, ... Pin
Luc Pattyn3-Nov-09 23:36
sitebuilderLuc Pattyn3-Nov-09 23:36 
GeneralRe: C# function(out byte buffer, ..) and its ActiveX module in C++ function(unsigned char* buffer, ... Pin
Chesnokov Yuriy4-Nov-09 1:03
professionalChesnokov Yuriy4-Nov-09 1:03 
GeneralRe: C# function(out byte buffer, ..) and its ActiveX module in C++ function(unsigned char* buffer, ... Pin
Luc Pattyn4-Nov-09 2:13
sitebuilderLuc Pattyn4-Nov-09 2:13 
QuestionXML Query in C# Pin
Priyagdpl3-Nov-09 19:15
Priyagdpl3-Nov-09 19:15 
AnswerRe: XML Query in C# Pin
N a v a n e e t h3-Nov-09 19:17
N a v a n e e t h3-Nov-09 19:17 
AnswerRe: XML Query in C# Pin
Christian Graus3-Nov-09 19:19
protectorChristian Graus3-Nov-09 19:19 
QuestionHow to Get Property attribute from instance variable Pin
mmdullah3-Nov-09 17:17
mmdullah3-Nov-09 17:17 

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.