Click here to Skip to main content
15,888,239 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
try
               {
                   if(ds.Tables[0].Rows.Count > 0)
                   {
                       txtCompanyName.Text = ds.Tables[0].Rows[0][0].ToString();
                       txtCaption.Text = ds.Tables[0].Rows[0][1].ToString();
                       txtAddress1.Text = ds.Tables[0].Rows[0][2].ToString();
                       txtAddress2.Text = ds.Tables[0].Rows[0][3].ToString();
                       txtMobile.Text = ds.Tables[0].Rows[0][4].ToString();
                       txtEmail.Text = ds.Tables[0].Rows[0][5].ToString();
                       txtGstin.Text = ds.Tables[0].Rows[0][6].ToString();
                       txtCloudApi.Text = ds.Tables[0].Rows[0][7].ToString();
                       txtUsername.Text = ds.Tables[0].Rows[0][8].ToString();
                       txtPassword.Password = ds.Tables[0].Rows[0][9].ToString();
                       txtcombox.Text = ds.Tables[0].Rows[0][10].ToString();
                       picUserimage.Source.ToString();
                       txtActivationKey.Text = ds.Tables[0].Rows[0][12].ToString();
                       cmd.ExecuteNonQuery();
                       conn.Close();
                   }
               }
               catch (Exception ex)
               {
                   MessageBox.Show(ex.Message);
               }


What I have tried:

picUserimage.Source.ToString();
Posted
Updated 13-Sep-22 19:40pm

1 solution

Quote:
What I have tried:

C#
picUserimage.Source.ToString();
And what did you expect that to do?
All it does is get the Source property of the picUserImage control on the current form, convert it to a string (which will return the string "System.Windows.Media.ImageSource" because it doesn't implement ToString as it has no idea what you want) ... and then throw that string away.

Looking at this along with your other 16 questions, it's pretty clear that you aren't thinking about what you are doing, just guessing and hoping it will work, or someone else will sort it all out for you.
That's not a valid design methodology: it's unbelievably slow, inefficient, and quickly leads to two things: 1) you annoy everyone who might give you help so you run out of assistants to fix it; and 2) you fail your course / get fired because when it comes to the crunch and you can't get help (exam / boss watching you over your shoulder) it is very obvious that you know nothing about the subject.

So stop guessing, start thinking. It's much faster in the long run!
 
Share this answer
 
Comments
prashanth manoj 14-Sep-22 1:51am    
how to fetch image path load from another form
OriginalGriff 14-Sep-22 2:06am    
Oh, come on!
Just asking your original question in précis form doesn't make it any more intelligible, or answerable - you know that because you have been told it before!

Stop guessing and hoping: think about what you are trying to do, and if you really can't work it out then think about what other might need to know in order to help you.

Or talk it over with a rubber duck. No, seriously: it's a very effective way of solving problems!
https://en.wikipedia.org/wiki/Rubber_duck_debugging

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