Hi,
this is my code.can you please give me the sample code.in database for the radiobutton column as amountstatus from db itself it has to show whether it is paid/unpaid.
private void cmb_customername_SelectedIndexChanged(object sender, EventArgs e)
{
int invoiceno = 0;
if (cmb_customername.SelectedValue.ToString() != "System.data.datarowview" && cmb_customername.SelectedValue.ToString() != "" && cmb_customername.SelectedValue.ToString() != string.Empty)
{
invoiceno = Convert.ToInt32(cmb_customername.SelectedValue);
}
SqlConnection con = new SqlConnection("data source=mars-104;initial catalog=Sudheeptest;integrated security=true");
con.Open();
SqlCommand cmd=new SqlCommand ("select t2.compname,t2.compaddress,t2.invoiceno,t2.orderno,t2.ondate,t2.invoicedate,t2.amountstatus,t2.netamount,t2.netvat,t2.tamount,t1.particulars,t1.quantity,t1.perprice,t1.amount from tbl_report2 t2 left join tbl_report1 t1 on t1.invoiceno=t2.invoiceno where t2.invoiceno ="+ invoiceno +"",con );
SqlDataAdapter da = new SqlDataAdapter(cmd);
ds = new DataSet();
da.Fill(ds );
if (ds.Tables.Count > 0)
{
txt_customeraddress.Text = ds.Tables[0].Rows[0]["compaddress"].ToString();
txt_invoiceno.Text = ds.Tables[0].Rows[0]["invoiceno"].ToString();
txt_orderno.Text = ds.Tables[0].Rows[0]["orderno"].ToString();
txt_ondate.Text = ds.Tables[0].Rows[0]["ondate"].ToString();
txt_invoicedate.Text = ds.Tables[0].Rows[0]["invoicedate"].ToString();
cmb_particulars.Text = ds.Tables[0].Rows[0]["particulars"].ToString();
txt_quantity.Text = ds.Tables[0].Rows[0]["Quantity"].ToString();
txt_perprice.Text = ds.Tables[0].Rows[0]["perprice"].ToString();
txt_amount.Text = ds.Tables[0].Rows[0]["amount"].ToString();
txt_netamount.Text = ds.Tables[0].Rows[0]["netamount"].ToString();
txt_netvat.Text = ds.Tables[0].Rows[0]["netvat"].ToString();
txt_tamount.Text = ds.Tables[0].Rows[0]["tamount"].ToString();
}
}
Best,
Sudheep.
Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator