Click here to Skip to main content
15,890,557 members
Home / Discussions / C#
   

C#

 
Questionitextsharp font question for pdf Pin
cromster8-Jun-11 3:42
cromster8-Jun-11 3:42 
AnswerRe: itextsharp font question for pdf Pin
BobJanova8-Jun-11 4:01
BobJanova8-Jun-11 4:01 
GeneralRe: itextsharp font question for pdf Pin
cromster8-Jun-11 4:28
cromster8-Jun-11 4:28 
GeneralRe: itextsharp font question for pdf Pin
BobJanova8-Jun-11 4:31
BobJanova8-Jun-11 4:31 
GeneralRe: itextsharp font question for pdf Pin
cromster8-Jun-11 4:39
cromster8-Jun-11 4:39 
AnswerRe: itextsharp font question for pdf Pin
Luc Pattyn8-Jun-11 5:22
sitebuilderLuc Pattyn8-Jun-11 5:22 
GeneralRe: itextsharp font question for pdf Pin
gavindon8-Jun-11 6:12
gavindon8-Jun-11 6:12 
QuestionAutoSizeMode = Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized. [modified] Pin
Zadbuke8-Jun-11 0:53
Zadbuke8-Jun-11 0:53 
Below there is code for update button the error for this code is mentioned in subject line.

private void update_Click(object sender, EventArgs e)
        {
            try
            {
                con.Open();
                OleDbDataReader dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    if (securityname.SelectedItem.ToString() == dr[0].ToString())
                    {
                        break;
                    }
                }

cmd.Parameters.AddWithValue("@User_Id", OleDbType.VarChar);
                cmd.Parameters.AddWithValue("@Security_Name", OleDbType.VarChar);
                cmd.Parameters.AddWithValue("@qty_bought", OleDbType.Integer);
                cmd.Parameters.AddWithValue("@qty_sold", OleDbType.Integer);
                cmd.Parameters.AddWithValue("@Rate_Security", OleDbType.Double);
                cmd.Parameters.AddWithValue("@Total_security", OleDbType.Double);
                cmd.Parameters.AddWithValue("@Brokerage", OleDbType.Double);
                cmd.Parameters.AddWithValue("@Net_Rate", OleDbType.Double);
                cmd.Parameters.AddWithValue("@Service_Tax", OleDbType.Double);
                cmd.Parameters.AddWithValue("@Stt_Amt", OleDbType.Double);
                cmd.Parameters.AddWithValue("@Total_Amt", OleDbType.Double);
                cmd.Parameters.AddWithValue("@Net_Delivery", OleDbType.Double);
                cmd.Parameters.AddWithValue("@Tran_Charges", OleDbType.Double);
                cmd.Parameters.AddWithValue("@Sec_Tran_Charges", OleDbType.Double);
                cmd.Parameters.AddWithValue("@Stamp_Duty", OleDbType.Double);
                cmd.Parameters.AddWithValue("@Total_due", OleDbType.Double);
                cmd.Parameters.AddWithValue("@NSE", OleDbType.Boolean);
cmd.CommandText = "Update Security SET qty_bought=@qty_bought,qty_sold=@qty_sold,Rate_Security=@Rate_Security,Total_Security=@Total_Security,Brokerage=@Brokerage,Net_Rate=@Net_Rate,Service_Tax=@Service_Tax,Stt_Amt=@Stt_Amt,Total_Amt=@Total_Amt,Net_Delivery=@Net_Delivery,Tran_Charges=@Tran_Charges,Sec_Tran_Charges=@Sec_Tran_Charges,Stamp_Duty=@Stamp_Duty,Total_due=@Total_due,NSE=@NSE Where Security_Name=@Security_Name AND User_Id=@User_Id";

securityTableAdapter.Update(strUserId, Convert.ToInt32(Qty_biught.Text), Convert.ToInt32(qty_sold.Text), Convert.ToDouble(gross_rate.Text), Convert.ToDouble(tot.Text), Convert.ToDouble(broker.Text), Convert.ToDouble(Net_rate.Text), Convert.ToDouble(Serv_Tax.Text), Convert.ToDouble(stt_amt.Text), dTot, Convert.ToDouble (Net_Del.Text), Convert.ToDouble(Tran_chr.Text), Convert.ToDouble(Sec_tran_tax.Text), Convert.ToDouble(stamp_duty.Text), Convert.ToDouble(bal_amt.Text), NSE.Checked, dr[0].ToString(), dr[1].ToString(), Convert.ToInt32(dr[2].ToString()), Convert.ToInt32(dr[3].ToString()), Convert.ToDouble(dr[4].ToString()), Convert.ToDouble(dr[5].ToString()), Convert.ToDouble(dr[6].ToString()), Convert.ToDouble(dr[7].ToString()), Convert.ToDouble(dr[8].ToString()), Convert.ToDouble(dr[9].ToString()), Convert.ToDouble(dr[10].ToString()), Convert.ToDouble(dr[11].ToString()), Convert.ToDouble(dr[12].ToString()), Convert.ToDouble(dr[13].ToString()), Convert.ToDouble(dr[14].ToString()), Convert.ToDouble(dr[15].ToString()), Convert.ToBoolean(dr[16].ToString()));

dr.Close();
                cmd.ExecuteNonQuery();
                Security_name.Text = securityname.Text;
                securityname.Visible = false;
                Security_name.Visible = true;
                con.Close();
}
catch (Exception ex)
           {
               con.Close();
               MessageBox.Show(ex.ToString());
           }
       }

Bold code is having a exception and I made all initialization regarding Connection and Command in Load_Form().

modified on Thursday, June 9, 2011 12:31 AM

AnswerRe: AutoSizeMode = Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized. Pin
Luc Pattyn8-Jun-11 1:48
sitebuilderLuc Pattyn8-Jun-11 1:48 
QuestionSending HttpWebRequest with a Unicode string Pin
ShadowUz7-Jun-11 18:58
ShadowUz7-Jun-11 18:58 
AnswerRe: Sending HttpWebRequest with a Unicode string Pin
Peter_in_27807-Jun-11 21:30
professionalPeter_in_27807-Jun-11 21:30 
AnswerRe: Sending HttpWebRequest with a Unicode string Pin
BobJanova7-Jun-11 23:20
BobJanova7-Jun-11 23:20 
GeneralRe: Sending HttpWebRequest with a Unicode string Pin
ShadowUz9-Jun-11 16:20
ShadowUz9-Jun-11 16:20 
QuestionExecuting a delegate from one class and project to another [modified] Pin
MAW307-Jun-11 14:02
MAW307-Jun-11 14:02 
AnswerRe: Executing a delegate from one class and project to another Pin
DaveyM697-Jun-11 14:12
professionalDaveyM697-Jun-11 14:12 
GeneralRe: Executing a delegate from one class and project to another Pin
MAW307-Jun-11 14:35
MAW307-Jun-11 14:35 
AnswerRe: Executing a delegate from one class and project to another Pin
PIEBALDconsult7-Jun-11 15:31
mvePIEBALDconsult7-Jun-11 15:31 
GeneralRe: Executing a delegate from one class and project to another [modified] Pin
MAW307-Jun-11 15:52
MAW307-Jun-11 15:52 
GeneralRe: Executing a delegate from one class and project to another [modified] Pin
PIEBALDconsult7-Jun-11 17:34
mvePIEBALDconsult7-Jun-11 17:34 
GeneralRe: Executing a delegate from one class and project to another Pin
MAW307-Jun-11 20:48
MAW307-Jun-11 20:48 
GeneralRe: Executing a delegate from one class and project to another Pin
PIEBALDconsult8-Jun-11 2:31
mvePIEBALDconsult8-Jun-11 2:31 
QuestionHelp reading window titles and text in c sharp Pin
turbosupramk37-Jun-11 6:15
turbosupramk37-Jun-11 6:15 
AnswerRe: Help reading window titles and text in c sharp Pin
SledgeHammer017-Jun-11 7:32
SledgeHammer017-Jun-11 7:32 
GeneralRe: Help reading window titles and text in c sharp Pin
turbosupramk37-Jun-11 11:05
turbosupramk37-Jun-11 11:05 
GeneralRe: Help reading window titles and text in c sharp Pin
SledgeHammer017-Jun-11 11:44
SledgeHammer017-Jun-11 11:44 

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.