4 Replies - 5696 Views - Last Post: 20 August 2011 - 08:20 AM Rate Topic: -----

#1 hrmtsngh86@gmail.com  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 19-August 11

how save multi rows into window application c# in dot net

Posted 19 August 2011 - 05:02 AM

how save multi rows into window application c# in dot net
Is This A Good Question/Topic? 0
  • +

Replies To: how save multi rows into window application c# in dot net

#2 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1003
  • View blog
  • Posts: 3,562
  • Joined: 05-June 09

Re: how save multi rows into window application c# in dot net

Posted 19 August 2011 - 05:08 AM

foreach(Row row in rows) {
     row.Save();
}


What are you talking about? Any example code? What are these "rows"?
Was This Post Helpful? 0
  • +
  • -

#3 hrmtsngh86@gmail.com  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 19-August 11

Re: how save multi rows into window application c# in dot net

Posted 19 August 2011 - 05:17 AM

i want save datagrid of rows and multicolumn of data grid row if my cloumns is in db is rate,amount and total.
i am trying
this is class
 public void insertBill(int PartyName, string OrderNo, string Particulars, string Quantity, string rate,string amount,string total,string vat,string grandtotal,string Bdate)
    {
        string Qry = "Insert Into bill(party,purchaseorder,particulars,quantity,rate,amount,total,vat,grandtotal,Bdate) Values (@party,@purchaseorder,@particulars,@quantity,@rate,@amount,@total,@vat,@grandtotal,@Bdate)";
        cmd = new SqlCommand(Qry, con);
        cmd.Parameters.Add("@party", SqlDbType.Int).Value = PartyName;
        cmd.Parameters.Add("@purchaseorder", SqlDbType.VarChar, 50).Value = OrderNo;
        cmd.Parameters.Add("@particulars", SqlDbType.VarChar,50).Value = Particulars;
        cmd.Parameters.Add("@quantity", SqlDbType.VarChar, 50).Value = Quantity;
        cmd.Parameters.Add("@rate", SqlDbType.VarChar, 50).Value = rate;
        cmd.Parameters.Add("@amount", SqlDbType.VarChar, 50).Value = amount;
        cmd.Parameters.Add("@total", SqlDbType.VarChar, 50).Value = total;
        cmd.Parameters.Add("@vat", SqlDbType.VarChar, 50).Value = vat;
        cmd.Parameters.Add("@grandtotal", SqlDbType.VarChar, 50).Value = grandtotal;
        cmd.Parameters.Add("@Bdate", SqlDbType.VarChar,50).Value = Bdate;


        if (con.State == ConnectionState.Open)
        { con.Close(); }
        con.Open();
        cmd.ExecuteNonQuery();
        con.Close();

    }


and on page
  if (lblId.Text == "Generating.....")
            {
                obj1.insertBill(Convert.ToInt32(cmboParty.SelectedValue), txtOrder.Text, "", "", "", "", "", "", "", "");
                MessageBox.Show("Record Saved Successfully");
                ClearData();

            }

This post has been edited by Curtis Rutland: 19 August 2011 - 06:51 AM

Was This Post Helpful? 0
  • +
  • -

#4 sithius92  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 36
  • View blog
  • Posts: 162
  • Joined: 01-August 08

Re: how save multi rows into window application c# in dot net

Posted 19 August 2011 - 06:43 AM

Please remember to use [code] tags when posting code.

What are you trying to save your row to? A database? A text file?
Was This Post Helpful? 1
  • +
  • -

#5 hrmtsngh86@gmail.com  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 19-August 11

Re: how save multi rows into window application c# in dot net

Posted 20 August 2011 - 08:20 AM

sithius92, on 19 August 2011 - 06:43 AM, said:

vff[/il]313761380' post='1415641']
Please remember to use [code] tags when posting code.

What are you trying to save your row to? A database? A text file?


i m trying to save datagrid columns text save to the sql table. I want generate reoport of that
like Purchase Order Or Like bill
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1