473,669 Members | 2,415 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.GetDa taObject() 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 3260
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(tru e) 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.GetDa taObject() 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.GetDa taObject(), 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
2131
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 can select customer details which form the proposal / invoice header. The user can also select certain products which can be added to the proposal "dataset". The selected product items are displayed in a listview control. My question is as...
1
1728
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 a beginner in XML/XSLT so was hoping someone would be able to give me some good info/tips on how to do this, and/or pointers to examples/documentation. I would like to do draw up something using VB.NET as I have Visual Studio as well as some...
3
7242
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 application that currently live in an Excel workbook as VBA solely for this one function. I'd like to move this to a VB.NET Windows form application that does not rely on Excel.
6
7084
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 already a useful library out there which I might have a look at.. Thanks, -J
5
1757
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 in Excel? So far I have managed to have the query automated (by using task scheduler), Output to Excel from here I need to browse to the LAN and manually save it? I would like to have this all automated? Im using Microsoft 2003 on Windows XP ...
0
1987
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 the dataGridView only the text-cells are copied and pasted in word, the image-cells are empty. How can I build an IDataObject that can contain text and images like it is possible when copy from word to word?
2
3348
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 I end up getting ComExceptions when using the examples. I've got Microsoft Excel 11.0 Object Library included as a Reference in my solution. Does anyone know of a good example of exporting from a DataGridView to an Excel binary XLS file? Or,...
3
3767
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
881
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 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.
0
8383
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8587
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7407
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6210
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5682
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4206
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2029
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.