473,469 Members | 1,447 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

save attachments in MS Access via a web form

Hi,

I have a C# web application in ASP.Net, which has a user contact info DB in
MS Access. Can I add a column to each user to save pdf attachments for each
user if needed? If so, how do we do this?

Thanks for help.

-Dale

Nov 17 '05 #1
4 3051
Dale,

I don't think that you want to dynamically add a new column for every
user. Rather, you should have a table which has a user name, and a blob
field (binary, varbinary) which you can then store the bytes of the file in.
This is accompished easily through the appropriate data adapter, which will
more than likely represent the column as a byte array in the data set.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:C3**********************************@microsof t.com...
Hi,

I have a C# web application in ASP.Net, which has a user contact info DB
in
MS Access. Can I add a column to each user to save pdf attachments for
each
user if needed? If so, how do we do this?

Thanks for help.

-Dale

Nov 17 '05 #2
Nicholas,

Sure, I would have a static column dedicated for this. In MS Access, a blob
field means an OLE object? Is there any example and info about this?

Thanks. -Dale

"Nicholas Paldino [.NET/C# MVP]" wrote:
Dale,

I don't think that you want to dynamically add a new column for every
user. Rather, you should have a table which has a user name, and a blob
field (binary, varbinary) which you can then store the bytes of the file in.
This is accompished easily through the appropriate data adapter, which will
more than likely represent the column as a byte array in the data set.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:C3**********************************@microsof t.com...
Hi,

I have a C# web application in ASP.Net, which has a user contact info DB
in
MS Access. Can I add a column to each user to save pdf attachments for
each
user if needed? If so, how do we do this?

Thanks for help.

-Dale


Nov 17 '05 #3
Dale,

Yes, an OLE object field is what you want.

Check out the article titled "Reading and Writing Bitmaps or BLOB Data
in ADO.NET" at (watch for line wrap):

http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp

It's in VB, but you can easily change that to C#.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:13**********************************@microsof t.com...
Nicholas,

Sure, I would have a static column dedicated for this. In MS Access, a
blob
field means an OLE object? Is there any example and info about this?

Thanks. -Dale

"Nicholas Paldino [.NET/C# MVP]" wrote:
Dale,

I don't think that you want to dynamically add a new column for every
user. Rather, you should have a table which has a user name, and a blob
field (binary, varbinary) which you can then store the bytes of the file
in.
This is accompished easily through the appropriate data adapter, which
will
more than likely represent the column as a byte array in the data set.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:C3**********************************@microsof t.com...
> Hi,
>
> I have a C# web application in ASP.Net, which has a user contact info
> DB
> in
> MS Access. Can I add a column to each user to save pdf attachments for
> each
> user if needed? If so, how do we do this?
>
> Thanks for help.
>
> -Dale
>


Nov 17 '05 #4
Nicholas,

The article is very good. When i tried to translate it to C# as below:

Image curImage = null;
string curFileName = null;
string savedImageName = "C:\\imageFromDb.BMP";

The compiler can not understand "Image" as below:
c:\inetpub\wwwroot\passwordProtectCSharp\adminUser File.aspx.cs(33): 'Image'
is an ambiguous reference

Any idea? Thanks. -Dale
"Nicholas Paldino [.NET/C# MVP]" wrote:
Dale,

Yes, an OLE object field is what you want.

Check out the article titled "Reading and Writing Bitmaps or BLOB Data
in ADO.NET" at (watch for line wrap):

http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp

It's in VB, but you can easily change that to C#.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:13**********************************@microsof t.com...
Nicholas,

Sure, I would have a static column dedicated for this. In MS Access, a
blob
field means an OLE object? Is there any example and info about this?

Thanks. -Dale

"Nicholas Paldino [.NET/C# MVP]" wrote:
Dale,

I don't think that you want to dynamically add a new column for every
user. Rather, you should have a table which has a user name, and a blob
field (binary, varbinary) which you can then store the bytes of the file
in.
This is accompished easily through the appropriate data adapter, which
will
more than likely represent the column as a byte array in the data set.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"dale zhang" <da*******@discussions.microsoft.com> wrote in message
news:C3**********************************@microsof t.com...
> Hi,
>
> I have a C# web application in ASP.Net, which has a user contact info
> DB
> in
> MS Access. Can I add a column to each user to save pdf attachments for
> each
> user if needed? If so, how do we do this?
>
> Thanks for help.
>
> -Dale
>


Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Steve | last post by:
How do you programatically save files that are attached to an email to a specified folder? It could be one file or multiple files attached to the email. Can it be done if Outlook Express is being...
1
by: bburton | last post by:
I'm using a form in Access which was used as a bug tracker. The users could update the record with an attachment. (The data type of the field that is used for attachments is the OLE Object) I...
4
by: MW de Jager | last post by:
I am sending an email with attachments from a dotnet ASP application. If I send an email it works fine if the attachment is located in a folder on my pc, which is open to all users on that PC, it...
0
by: fish | last post by:
Hi, I have a VB.net application that will save attachments to a directory on my local pc. I need to run this component on our exchange 2003 server and also save the attachments to a local DIR. ...
1
by: mike11d11 | last post by:
If someone could help me, I need to be able to send attachments from my access database that I have created. This database runs queries then generates a report off the queries from underlying...
5
by: gazelle04 | last post by:
I want to save a file for a data in a Database. I'm working on a Schools Database and I want to have a command button that says "Attachments" for a particular "School". Attachments may vary from Word...
4
by: sonja.chevre | last post by:
Hello ! I'm looking for a script which allows me to read emails and attachment from a pop server (then I'll save the email's text in a db and the attachments on the server). So I have found...
1
by: santosh singh | last post by:
for mobile browser i used the following code : Response.ContentType = "application/vnd.wap.xhtml+xml"; Response.AppendHeader("Content-Disposition","attachment; filename=SailBig.jpg");...
4
by: kpfunf | last post by:
When I email a report via macro or vba code, the attached report is named "Fuel Quote Report.(ext)". I have no idea how this name is used. I have three seperate macros sending three seperate reports....
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.