Click here to Skip to main content
16,016,301 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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);
              }
          }


What I have tried:

picUserimage.Source.ToString();
Posted
Updated 12-Sep-22 0:54am

1 solution

Four hours ago, I warned you about string concatenation: There is no at 0 position[^]
But ... you haven't learned.

If you don't think it's serious, Google "bobby tables" and find out.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900