Click here to Skip to main content
15,901,805 members
Home / Discussions / C#
   

C#

 
GeneralRe: checkedlistbox - windows application Pin
havejeet21-May-09 20:14
havejeet21-May-09 20:14 
GeneralRe: checkedlistbox - windows application Pin
0x3c021-May-09 21:56
0x3c021-May-09 21:56 
GeneralRe: checkedlistbox - windows application Pin
havejeet21-May-09 23:57
havejeet21-May-09 23:57 
GeneralRe: checkedlistbox - windows application Pin
havejeet23-May-09 1:50
havejeet23-May-09 1:50 
QuestionHow to add .Net framework in an msi setup? Pin
svt gdwl21-May-09 18:43
svt gdwl21-May-09 18:43 
AnswerRe: How to add .Net framework in an msi setup? Pin
MumbleB21-May-09 19:14
MumbleB21-May-09 19:14 
QuestionSending mail from localhost application and from live server Pin
logicaldna21-May-09 17:45
logicaldna21-May-09 17:45 
QuestionError in retrieving data from SQL Pin
misCafe21-May-09 15:48
misCafe21-May-09 15:48 
Dear brothers,

I have read the book and searched from the internet. They told me the same way in retrieving data from SQL server. Unfortunately, it errors something when I do the same way. See my codes below :

private void btn_login_Click(object sender, EventArgs e)
{
string sSQL = "SELECT USERNAME, USERPASSWORD FROM TBL_USER WHERE USERNAME = '" + this.txt_username.Text + "' AND USERPASSWORD = '" + this.txt_username.Text + "'";
SqlCommand sCommand = new SqlCommand(sSQL, dbConnection.sqlCnn);

try
{
dbConnection.sqlCnn.Open();
SqlDataAdapter sReader = sCommand.ExecuteReader();
// It says : "Cannot implicitly convert type'System.Data.SqlClient.SqlDataReader' to 'System.Data.SqlClient.SqlDataAdapter'"


while (sReader.Read() == true)
{
frm_main frmparents = new frm_main();
frmparents.ShowDialog();
}
}
catch (Exception Er)
{
MessageBox.Show(Er.Message, "Exception");
}

Thanks for reading the entire article.

Chuon Visoth
Angkor Wat - Cambodia
asp.net - c sharp beginner

AnswerRe: Error in retrieving data from SQL Pin
Luc Pattyn21-May-09 16:11
sitebuilderLuc Pattyn21-May-09 16:11 
GeneralRe: Error in retrieving data from SQL Pin
misCafe21-May-09 16:34
misCafe21-May-09 16:34 
GeneralRe: Error in retrieving data from SQL Pin
Luc Pattyn21-May-09 17:00
sitebuilderLuc Pattyn21-May-09 17:00 
AnswerRe: Error in retrieving data from SQL Pin
dan!sh 21-May-09 17:03
professional dan!sh 21-May-09 17:03 
GeneralRe: Error in retrieving data from SQL Pin
misCafe21-May-09 18:57
misCafe21-May-09 18:57 
GeneralRe: Error in retrieving data from SQL Pin
MumbleB21-May-09 19:27
MumbleB21-May-09 19:27 
GeneralRe: Error in retrieving data from SQL Pin
misCafe21-May-09 20:33
misCafe21-May-09 20:33 
QuestionRepeated code with little difference Pin
Xenoserv21-May-09 12:09
Xenoserv21-May-09 12:09 
AnswerRe: Repeated code with little difference Pin
Luc Pattyn21-May-09 12:46
sitebuilderLuc Pattyn21-May-09 12:46 
AnswerRe: Repeated code with little difference Pin
_Maxxx_21-May-09 17:30
professional_Maxxx_21-May-09 17:30 
QuestionSleek looking window application Pin
humayunlalzad21-May-09 12:09
humayunlalzad21-May-09 12:09 
AnswerRe: Sleek looking window application Pin
EliottA21-May-09 12:37
EliottA21-May-09 12:37 
AnswerRe: Sleek looking window application Pin
_Maxxx_21-May-09 17:32
professional_Maxxx_21-May-09 17:32 
GeneralRe: Sleek looking window application Pin
humayunlalzad22-May-09 5:21
humayunlalzad22-May-09 5:21 
QuestionHow to get custom attributes from a function called by delegate? [modified] Pin
Anindya Chatterjee21-May-09 11:24
Anindya Chatterjee21-May-09 11:24 
Questiondatagrid reorder Pin
michaelgr121-May-09 10:19
michaelgr121-May-09 10:19 
AnswerRe: datagrid reorder Pin
Luc Pattyn21-May-09 10:30
sitebuilderLuc Pattyn21-May-09 10:30 

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.