Dear teacher I got a problem with these code private void - TopicsExpress



          

Dear teacher I got a problem with these code private void button7_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(SELECT TOP 1 Exchange FROM ExchangeRate ORDER BY ID DESC, cn); SqlDataAdapter adapter=new SqlDataAdapter(cmd); DataTable table=new DataTable(); adapter.Fill(table); decimal exchange = 0; if (table.Rows.Count > 0) exchange = Convert.ToDecimal(table.Rows[0][0]); UserLog.Exchange = exchange; BillingFrom f=new BillingFrom(); f.label1.Text = label2.Text; f.label2.Text = (Convert.ToDecimal(label2.Text)*exchange).ToString(#,0); decimal decimalplace =Convert.ToDecimal(f.label2.Text.Substring(f.label2.Text.Length - 2, 2)); decimal front = Convert.ToDecimal(f.label2.Text.Substring(0, f.label2.Text.Length-2) + 00); if (decimalplace > 10) front = front + 100; f.label2.Text = front.ToString(#,0); f.ShowDialog(); if (f.DialogResult == DialogResult.OK) { cmd=new SqlCommand(,cn); try { cmd.Transaction = cn.BeginTransaction(); cmd.CommandText = INSERT INTO ReceiptHeader values(@ReceiptNo,@ReceiptDate,@Seller,; cmd.Transaction.Commit(); } catch (Exception ex) { cmd.Transaction.Rollback(); MessageBox.Show(ex.Message); } } f.Close(); }
Posted on: Thu, 23 Oct 2014 13:41:37 +0000

Trending Topics



in-left:0px; min-height:30px;"> MODIFIED NATIONAL POINTS 2013 As of June 28,2013

Recently Viewed Topics




© 2015