How to Export gridview data to Excel file in VB.NET standalone application
-
I need to Export data in a Gridview to Excel file, please any body help... I tried a lot but could'nt make it. The application is made in VB.NET standalone (NOT web based) I have a gridview with data, i need to export it to .xls or .csv file please help...
Jats
-
I need to Export data in a Gridview to Excel file, please any body help... I tried a lot but could'nt make it. The application is made in VB.NET standalone (NOT web based) I have a gridview with data, i need to export it to .xls or .csv file please help...
Jats
Don't cross post. You already posted this same question in the article I would have pointed you at. If you can't read the article and code in it and understand what it does, noone is going to be able to explain the process to you in a much shorter forum post that will offer nowhere near as much explanation. If you want other examples you can try, Google for "VB.NET export data to Excel".
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Don't cross post. You already posted this same question in the article I would have pointed you at. If you can't read the article and code in it and understand what it does, noone is going to be able to explain the process to you in a much shorter forum post that will offer nowhere near as much explanation. If you want other examples you can try, Google for "VB.NET export data to Excel".
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Sorry for cross posting. But the code project page was showing error when i posted in the article. So i posted here again. May be the CodeProject site is not working properly. I suppose. By the way i read the article and understood very well but i have no knowledge of C# so hoping some body can help me.
Jats
-
Sorry for cross posting. But the code project page was showing error when i posted in the article. So i posted here again. May be the CodeProject site is not working properly. I suppose. By the way i read the article and understood very well but i have no knowledge of C# so hoping some body can help me.
Jats
Jats_4ru wrote:
but i have no knowledge of C#
BS. You know more than you think you do. Take a look at a bunch of documentation in the MSDN Help for Visual Studio. Notice that there are thousands of examples of small bits of code in both C# AND VB.NET. Compare the two and you'll find C# has a lot in common with VB. Most of what you see has nothing to do with either language anyway since alot of code just manipulates objects in the .NET Framework. For example, these two pieces out of the MSDN docs on the ManagementObjectSearcher class are, line-for-line, identical:
' VB.NET
Imports System
Imports System.ManagementPublic Class Sample
Public Overloads Shared Function _
Main(ByVal args() As String) As IntegerDim s As New ManagementObjectSearcher( \_ "root\\MyApp", \_ "SELECT \* FROM Win32\_Service", \_ New EnumerationOptions( \_ Nothing, System.TimeSpan.MaxValue, 1, \_ True, False, True, True, False, \_ True, True)) For Each service As ManagementObject In s.Get() 'show the instance Console.WriteLine(service.ToString()) Next End Function
End Class
// C#
using System;
using System.Management;public class Sample
{
public static void Main(string[] args)
{
ManagementObjectSearcher s =
new ManagementObjectSearcher(
"root\\CIMV2",
"SELECT * FROM Win32_Service",
new EnumerationOptions(
null, System.TimeSpan.MaxValue,
1, true, false, true,
true, false, true, true));foreach (ManagementObject service in s.Get()) { // show the service Console.WriteLine(service.ToString()); } }
}
All you have to do is compare each line to see that they both specify the exact same things, just using a slightly different syntax.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
I need to Export data in a Gridview to Excel file, please any body help... I tried a lot but could'nt make it. The application is made in VB.NET standalone (NOT web based) I have a gridview with data, i need to export it to .xls or .csv file please help...
Jats
Don't cross post. It's just plain rude.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer