Click here to Skip to main content
15,884,628 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
This c# code works fine in wpf framework.
Now I need this code in asp.net.
I am using GridView instead of DataGrid.
What changes do I have to do?



Here is my c# code:

C#
DataRowView SelectedRowValue = (DataRowView)dataGrid1.SelectedValue;
byte[] ImageBytes = (byte[])SelectedRowValue.Row.ItemArray[1];
MySqlCommand cmd2 = new MySqlCommand("INSERT INTO Images (Image) VALUES (@ImageSource)", con);
cmd2.Parameters.Add("@ImageSource", MySqlDbType.Blob, ImageBytes.Length).Value = ImageBytes;
cmd2.ExecuteNonQuery();


What I have tried:

I changed dataGrid1 to gridView1
Posted
Comments
Beginner Luck 7-Aug-16 23:09pm    
which langauage you using
abdujalilc 8-Aug-16 3:56am    
I am using C#.

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