Click here to Skip to main content
15,912,756 members
Home / Discussions / C#
   

C#

 
GeneralRe: Exception handling : code Pin
Christian Graus25-Nov-08 19:54
protectorChristian Graus25-Nov-08 19:54 
GeneralRe: Exception handling : code Pin
HosamAly25-Nov-08 20:10
HosamAly25-Nov-08 20:10 
QuestionFacebook Question Pin
Dav Zen25-Nov-08 14:43
Dav Zen25-Nov-08 14:43 
AnswerRe: Facebook Question Pin
Christian Graus25-Nov-08 14:45
protectorChristian Graus25-Nov-08 14:45 
GeneralRe: Facebook Question Pin
Paul Conrad25-Nov-08 18:29
professionalPaul Conrad25-Nov-08 18:29 
GeneralRe: Facebook Question Pin
Christian Graus25-Nov-08 18:52
protectorChristian Graus25-Nov-08 18:52 
GeneralRe: Facebook Question Pin
Paul Conrad25-Nov-08 18:59
professionalPaul Conrad25-Nov-08 18:59 
Questionreader is closed how can i solve this Pin
cutedrew25-Nov-08 14:13
cutedrew25-Nov-08 14:13 
here's my sample program in my addProducts..
if i click my save button.. when i run it, i prompts an error message that reader is closed.. can anyone help me?

private void btnSaveChangesObject_Click(object sender, EventArgs e)
{
try
{
clsPublic.objConn.Open();
OdbcCommand com = new OdbcCommand("Select Name from Products", clsPublic.objConn);

OdbcDataReader read;
read = com.ExecuteReader();


while (read.Read())
{
if (read[0].ToString() == txtprodname.Text)
{
MessageBox.Show("Error!");

}


else

try
{
String strSQL;

if (clsPublic.BoolUpdateProductsRec == true)
{

strSQL = "Update products Set Id = '" + txtprodId.Text +
"', Name = '" + txtprodname.Text +
"', Description = '" + txtdesc.Text +
"', Type = '" + txttype.Text +
"', Price = '" + txtprice.Text +
"', Brand = '" + txtbrand.Text +
"' where Id = '" + txtprodId.Text + "'";
}


else
{

strSQL = "Insert Into products Values('" + txtprodId.Text +
"', '" + txtprodname.Text +
"', '" + txtdesc.Text +
"', '" + txttype.Text +
"', '" + txtprice.Text +
"', '" + txtbrand.Text + "')";
}


SaveObjectRecord(strSQL);
btnCloseSaveChangesObject.PerformClick();

}


catch (NullReferenceException NRE)
{
MessageBox.Show("Error:" + NRE.Message, "ARTM", MessageBoxButtons.OK, MessageBoxIcon.Error);
}

}

}
catch (NullReferenceException NRE)
{
MessageBox.Show("Error:" + NRE.Message, "ARTM", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
AnswerRe: reader is closed how can i solve this Pin
Christian Graus25-Nov-08 14:47
protectorChristian Graus25-Nov-08 14:47 
GeneralRe: reader is closed how can i solve this Pin
Paul Conrad25-Nov-08 18:30
professionalPaul Conrad25-Nov-08 18:30 
GeneralRe: reader is closed how can i solve this Pin
Christian Graus25-Nov-08 18:53
protectorChristian Graus25-Nov-08 18:53 
GeneralRe: reader is closed how can i solve this Pin
Paul Conrad25-Nov-08 18:56
professionalPaul Conrad25-Nov-08 18:56 
AnswerRe: reader is closed how can i solve this Pin
Guffa25-Nov-08 15:06
Guffa25-Nov-08 15:06 
AnswerRe: reader is closed how can i solve this Pin
Giorgi Dalakishvili25-Nov-08 19:31
mentorGiorgi Dalakishvili25-Nov-08 19:31 
QuestionNullReferenceException with delegate function. Pin
Teuz25-Nov-08 12:54
Teuz25-Nov-08 12:54 
AnswerRe: NullReferenceException with delegate function. Pin
Christian Graus25-Nov-08 14:01
protectorChristian Graus25-Nov-08 14:01 
GeneralRe: NullReferenceException with delegate function. Pin
Teuz25-Nov-08 14:24
Teuz25-Nov-08 14:24 
GeneralRe: NullReferenceException with delegate function. Pin
Christian Graus25-Nov-08 14:54
protectorChristian Graus25-Nov-08 14:54 
GeneralRe: NullReferenceException with delegate function. Pin
Teuz25-Nov-08 23:28
Teuz25-Nov-08 23:28 
Questionlistbox index Pin
netJP12L25-Nov-08 10:28
netJP12L25-Nov-08 10:28 
AnswerRe: listbox index Pin
Christian Graus25-Nov-08 12:02
protectorChristian Graus25-Nov-08 12:02 
QuestionDrag Drop | Getting drop location in explorer Pin
Corayzon25-Nov-08 10:19
Corayzon25-Nov-08 10:19 
QuestionControl Paints Different in App and Designer Pin
#realJSOP25-Nov-08 8:15
professional#realJSOP25-Nov-08 8:15 
AnswerRe: Control Paints Different in App and Designer Pin
Giorgi Dalakishvili25-Nov-08 8:55
mentorGiorgi Dalakishvili25-Nov-08 8:55 
GeneralRe: Control Paints Different in App and Designer Pin
#realJSOP25-Nov-08 9:36
professional#realJSOP25-Nov-08 9:36 

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.