954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Uploading and Image to SQL with TableAdapter.Insert

Hello Everyone

For a project from skool, I been in charge of development, and we already have the system, but they wanted to add images to the project, and since i been using the TableAdapter.Insert commando to add records to the database, I need to know how to send an Image with that command.

Here is my code

EmpTableAdapter.Insert(noemp.Text, nametb.Text, area.Text, DateTimePicker1.Text, "", "Active", "", HERE GOES THE IMAGE )


So the image goes in the last field, and when i created the form i took away the form controls that they appear when you add a datasource.

Thanks in Advance!

Regards

CrankyMero
Newbie Poster
24 posts since Jan 2011
Reputation Points: 10
Solved Threads: 2
 

Is it a web application (FileUploadControl to be used) or a windows application

>add a new column to the table to save the image
> use the binary data type for the image column in SQL-Server
>In your code, convert the image in the control to binary
> save to your database

Netcode
Veteran Poster
1,021 posts since Jun 2009
Reputation Points: 43
Solved Threads: 67
 

Windows Application, I've already solved my problem, but if you know how i would mind learning a new way of doing that

Regards

ZidaneXero
Newbie Poster
13 posts since Sep 2009
Reputation Points: 24
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: