Hi,
Recently i have faced a problem, which surely i think u guys will hae a solution.
Scenario:
I have a gridview, a picture box and a sql database.
Procedure:
Basically, its a client information entry form which takes in data from a user and stores it in a database and then recalls it in a gridview for administrative purposes.
The userclickes the picture box and gets a picture through a fileopendialog box, which is then converted into a byte array. i have made a client class which takes in all the client information using get/set properties, the image datatype is still unsure (need a little help on that too), then there is a stored procedure written which takes this class parameters and writes them to a database.
on the administrative side a connection is made to the sql server and a reader method is used which returns all the objects in the database and generates a list based on the client class. the class is then fed directly to the gridview as a datasource.
Problems:
Firstly there are no columns defined in gridview, it just takes the returned class and populates on that basis. probelm is with the image column. can u please guide me on storing image from picture box to the database and then retreiving into the gridview.
do i need to define all columns before populating it, and/or add a image column in it. Urgent help is required please.
PictureBox image convertsto byte array.
Sql database table has a field named 'ClientImage" of datatype 'image'
SqlReader method retrieves an object only, so one has to convert back to image
display this image with other info in gridview.
can u please help me on all these datatypes and how to show image in gridiew. it would be more helpful if i dont have to specify any columns in gridview, and directly populate from datasource.
Thanks in advance!!!!