public Add_Profile() { InitializeComponent(); value = New_Add_Profile.id; edit_val = New_Add_Profile.edit; if (edit_val == 1) { SqlConnection conn = new SqlConnection(ConnectionString); conn.Open(); SqlCommand cmd = new SqlCommand("SELECT company_name,caption,address1,address2,mobileno,email,gst,cloudApi,username,password,selectusertype,uploadlogo,activationkey FROM add_profile WHERE company_id = '" + value + "'", conn); DataTable dt = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); try { if(ds.Tables[0].Rows.Count > 0) { txtCompanyName.Text = ds.Tables[0].Rows[0][1].ToString();// Columns["company_name"].ToString(); txtCaption.Text = ds.Tables[0].Rows[0][2].ToString(); txtAddress1.Text = ds.Tables[0].Rows[0][3].ToString(); txtAddress2.Text = ds.Tables[0].Rows[0][4].ToString(); txtMobile.Text = ds.Tables[0].Rows[0][5].ToString(); txtEmail.Text = ds.Tables[0].Rows[0][6].ToString(); txtGstin.Text = ds.Tables[0].Rows[0][7].ToString(); txtCloudApi.Text = ds.Tables[0].Rows[0][8].ToString(); txtUsername.Text = ds.Tables[0].Rows[0][9].ToString(); txtPassword.Password = ds.Tables[0].Rows[0][10].ToString(); txtcombox.Text = ds.Tables[0].Rows[0][11].ToString(); picUserimage e. = ds.Tables[0].Rows[0][12].ToString();// = dt.Columns["company_id"].ToString(); txtActivationKey.Text = ds.Tables[0].Rows[0][13].ToString(); cmd.ExecuteNonQuery(); conn.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
picUserimage.Source.ToString();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)