Hi,
Am newborn to asp.net.I am creating a place using asp.net(C#), in officer tender i have
Hi,
Am newborn to asp.net.I am creating a place using asp.net(C#), in officer tender i have
Tags: button-option, problem, reset-itself, server-it-does
Posted in Tutorials | No Comments »
I had matured a VB.Net Function to goods datatable to surpass in my asp.net project. It worked dustlike in localhost. But when I uploaded my send in computer it does not work. Actually the .aspx tender itself is not loading. My Function is as follows,
Private Sub ExportToExcel()
FillString()
Dim ConnString As String = ConfigurationManager.ConnectionStrings("sewaonlineConnectionString").ConnectionString
Dim da As New SqlDataAdapter(sqlString, ConnString)
da.Fill(ds)
dt = ds.Tables(0)
Dim surpass As New Microsoft.Office.Interop.Excel.ApplicationClass
Dim wBook As Microsoft.Office.Interop.Excel.Workbook
Dim wSheet As Microsoft.Office.Interop.Excel.Worksheet
wBook = excel.Workbooks.Add()
wSheet = wBook.ActiveSheet()
Dim dc As System.Data.DataColumn
Dim dr As System.Data.DataRow
Dim colIndex As Integer = 0
Dim rowIndex As Integer = 0
For Each dc In dt.Columns
colIndex = colIndex + 1
excel.Cells(1, colIndex) = dc.ColumnName
Next
For Each dr In dt.Rows
rowIndex = rowIndex + 1
colIndex = 0
For Each dc In dt.Columns
colIndex = colIndex + 1
excel.Cells(rowIndex + 1, colIndex) = dr(dc.ColumnName)
Next
Next
wSheet.Columns.AutoFit()
Dim strFileName As String = "Workbook.xls"
Dim blnFileOpen As mathematician = False
Try
Dim fileTemp As System.IO.FileStream = System.IO.File.OpenWrite(strFileName)
fileTemp.Close()
Catch ex As Exception
blnFileOpen = False
End Try
If System.IO.File.Exists(strFileName) Then
System.IO.File.Delete(strFileName)
End If
wBook.SaveAs(strFileName)
excel.Workbooks.Open(strFileName)
excel.Visible = True
End Sub
Protected Sub btnExport_Click(ByVal communicator As Object, ByVal e As EventArgs) Handles btnExport.Click
ExportToExcel()
End Sub
Note: I had additional a meaning to Microsoft.Office.Interop.Excel in my send for this function. I had also proclaimed the datatable (dt) as orbicular variable.
What haw be the reason?
Also I would revalue if you could propose whatever change in the above
Tags: button-option, microsoft, server-it-does, system
Posted in Tutorials | No Comments »
i poverty create a fix choice that takes the whole datalist and converts it to a pdf file. As anyone finished this in asp.net?? if yes gratify do move
See the example post:
Please Login or Register to see the link.
Tags: a-pdf-file, button-option, datalist-and, user
Posted in Tutorials | No Comments »
The blog owner requires users to be logged in to be able to vote for this post.
Alternatively, if you do not have an account yet you can create one here.
Powered by Vote It Up
Feed News is proudly powered by
WordPress
Entries (RSS)
and Comments (RSS).