How to paste the values from clipboard back to datagridview

Posted on 2009-02-21
Last Modified: 2013-11-26
When I get the data stream from the clipboard, if there is a new line, should I get a \n?  But somehow when I do a debug, there is none.  No matter what data format I use, I still cannot get it.  Please help!
Dim s As String = Clipboard.GetData(DataFormats.CommaSeparatedValue)

Dim lines() As String = s.Split("\n")

Open in new window

Question by:johnyu1997
    LVL 15

    Accepted Solution

    simple use this

    Dim s As String = Clipboard.GetData(DataFormats.CommaSeparatedValue)
    Dim lines() As String = s.Split(vbCrLf)

    Open in new window

    LVL 15

    Expert Comment

    by:Praveen Venu
    May I know is there any issue why you posted B grade for it?

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    It’s quite interesting for me as I worked with Excel using for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now