473,508 Members | 3,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Copy from excel --> clipborad --> datagridview

3 New Member
Hello,
i am working with vs2008 (web application) and I want to copy some content from an excel sheet and and using the clipboard i want to copy the contents in a gridview

I have tried using Clipboard.GetDataObject() but no matter what ever i do it is always returning null so can anyone suggest me solution of how to implement this.

regards,
vamsi.
Jun 23 '10 #1
4 3252
Plater
7,872 Recognized Expert Expert
Is there anything IN the clipboard object? Like did you do a copy from excel?
Office has its own weird clipboard that might not put data into the regular clipboard until it thinks it needs it?

EDIT:
Calling .GetFormats(true) returned the following data types in my Clipboard from an excel copy:
Expand|Select|Wrap|Line Numbers
  1.  
  2.         [0]    "EnhancedMetafile"
  3.         [1]    "MetaFilePict"
  4.         [2]    "System.Drawing.Bitmap"
  5.         [3]    "Bitmap"
  6.         [4]    "Biff8"
  7.         [5]    "Biff5"
  8.         [6]    "BIFF4"
  9.         [7]    "Biff3"
  10.         [8]    "Biff"
  11.         [9]    "SymbolicLink"
  12.         [10]    "Wk1"
  13.         [11]    "DataInterchangeFormat"
  14.         [12]    "XML Spreadsheet"
  15.         [13]    "HTML Format"
  16.         [14]    "System.String"
  17.         [15]    "UnicodeText"
  18.         [16]    "Text"
  19.         [17]    "Csv"
  20.         [18]    "Rich Text Format"
  21.         [19]    "Embed Source"
  22.         [20]    "Object Descriptor"
  23.         [21]    "Link Source"
  24.         [22]    "Link Source Descriptor"
  25.         [23]    "Link"
  26.         [24]    "Format129"
  27.  
  28.  
Jun 23 '10 #2
vamsikrishna20
3 New Member
thanks for the reply but are you sure that you are using a web applicaion developed in vs2008 and windows 2003 as when i am tring to fetch teh data from teh clipboard by using teh object Clipboard.GetDataObject() it is always returning a null value so please let me know how do you want me to proceed regarding this issue.
Jun 24 '10 #3
Plater
7,872 Recognized Expert Expert
Ah ha! I missed that part about the web application!
Ok then. Well copy/paste is handled by the browser on the client side.
It if highly unlikely that any copy/paste operation will ever make it back to the server for it to process.

In IE, I think javascript can access that clipboard, but FF does not allow it.

What you could MAYBE do, is provide a small textbox, that the user will PASTE the data into, and you would have javascript watch for the changed event and it would then process the data and fill in your gridview?
Jun 24 '10 #4
Curtis Rutland
3,256 Recognized Expert Specialist
Remember: all .NET code is executed on the server. So when you're doing the Clipboard.GetDataObject(), you are accessing the Clipboard object of the server, not the client.
Jun 28 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2120
by: ExDelphi | last post by:
Hi All I am fairly new to VB.Net, and have gotten stuck with an invoicing application. My database (Access 2000 / 2003) is used to store records of our products, customers, suppliers etc. The user...
1
1722
by: Jano | last post by:
Hi all, I support a number of applications that store info in backend SQL databases. A project has come up where I need to get data out of Excel into one of these databases, using XML/XSLT. I am...
3
7234
by: MJ | last post by:
Is there a VB.NET (1.1 or 2.0) equivalent for Excel's ? Below is a copy of an example of the Excel VBA that I have been using to pull some data off a webpage. I've got a couple of simple...
6
7061
by: Joerg Battermann | last post by:
Hey there, mmmm does anyone know a library or anything I can use to convert plaintext to html real quick and vice-versa? Regex surely would do the trick to a certain level, but maybe there's...
5
1746
by: silvershadow | last post by:
Hi all, my first post on the forum so please be gentle.... I've just started using Macros in Access today, I would like to run a specific query on a daily basis and then have it saved on the LAN...
0
1971
by: Robert | last post by:
Hi! I want to fill the clipboard programmatically in oder to manual copy the data to word. The data consists of cells of a grid which contains text or images. Using the standard copy/paste of...
2
3336
by: Randy | last post by:
I've found several examples of exporting to Excel (XML) from a DataGridView. I need to export to an actual binary XLS file from a DataGridView. I've found what I think are a couple of examples but...
3
3756
by: admlangford | last post by:
Hi, I have a collection of objects which I am storing in a list the object looks like this struct Person { public int age; public string name; }
0
874
by: vamsikrishna20 | last post by:
Hello, i am working with vs2008 (web application) and I want to copy some content from an excel sheet and and using the clipboard i want to copy the contents in a gridview I have tried using...
0
7129
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
7398
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...
0
5637
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
4716
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
3208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1566
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 ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.