View Complete Post
Hi there,
I am trying to simply extract an excel data from an uploaded file an put it into a datatable. In this case the excel file has 3 rows but when I fill the datatable I only see row count of 2.
I tried changing HDR:NO; to HDR:YES and vice versa, but no luck.
What am I doing wrong? (Note: the excel file cannot have a headerrow)
string connstr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + pFilePath + ";Extended Properties=\"Excel 12.0;IMEX=1;HDR:NO;\""; OleDbConnection conn = new OleDbConnection(connstr); conn.Open(); DataTable dtTables = conn.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, null); string strTablename = dtTables.Rows[0]["TABLE_NAME"].ToString(); string strSQL = "SELECT * FROM [" + strTablename + "]"; OleDbCommand cmd = new OleDbCommand(strSQL, conn); DataTable dt = new DataTable(); OleDbDataAdapter da = new OleDbDataAdapter(cmd); da.Fill(dt); //At this point row count=2 which doesn't make sense
Steps I have followed are1.I have created myres.en-GB.resx file at C:.2.then created locale specific myres.en-GB.resources using resgen at c: only,resgen c:\myres.en-GB.resx 3.Linked the Resource File to Assembly using AL.exe which is giving me assembly at c: only.Al /t:lib /embed:myres.en-GB.resources /out:ClassLibrary1.dll4.I have created one web application using vs 2008 & then build it.5.Then placed both resource file & dll in web applications Bin\en-GB folder.6.Anf finally written code at page load like CultureInfo info = new CultureInfo("en-GB"); Thread.CurrentThread.CurrentCulture = info; Assembly asd = Assembly.Load("ClassLibrary1"); ResourceManager res = new ResourceManager("myres.en-GB", asd.GetSatelliteAssembly(info)); string sdf = res.GetString("Lab1");
but after running application I m getting following errorMissingManifestResourceException", "Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Cla
Privacy issues are of primary concern to those involved in Internet commerce. Some consumers are hesitant to provide information to Web sites without clearly understanding how their data will be used and with whom it will be shared.
MSDN Magazine August 2003
The Win32 Portable Executable File Format (PE) was designed to be a standard executable format for use on all versions of the operating systems on all supported processors. Since its introduction, the PE format has undergone incremental changes, and the introduction of 64-bit Windows has required a few more. Part 1 of this series presented an overview and covered RVAs, the data directory, and the headers. This month in Part 2 the various sections of the executable are explored. The discussion includes the exports section, export forwarding, binding, and delayloading. The debug directory, thread local storage, and the resources sections are also covered.
Matt Pietrek
MSDN Magazine March 2002
A good understanding of the Portable Executable (PE) file format leads to a good understanding of the operating system. If you know what's in your DLLs and EXEs, you'll be a more knowledgeable programmer. This article, the first of a two-part series, looks at the changes to the PE format that have occurred over the last few years, along with an overview of the format itself. After this update, the author discusses how the PE format fits into applications written for .NET, PE file sections, RVAs, the DataDirectory, and the importing of functions. An appendix includes lists of the relevant image header structures and their descriptions.
MSDN Magazine February 2002
The MIME-compliant content type, called multipart/form-data, makes writing HTML that uploads files almost trivial. On the server side though, ASP does not have a way to access data in the multipart/form-data format. The most flexible way to access the uploaded file is through a C++ ISAPI Extension DLL. This article describes a reusable ISAPI extension DLL that allows you to upload images and files without writing C++ code. It is coupled with a few COM components that make it readily reusable for ASP development. With .NET, this whole process is much easier, and this article shows preliminary code that uploads files using ASP.NET features.
Panos Kougiouris
MSDN Magazine October 2001
Hi everyone,
I am using a download handler to handle the downloading of files from my website. I am using a slightly modified code from the Microsoft article http://support.microsoft.com/kb/812406
Everything is working fine and downloading, even with large files, but it does not show the file size for any of the files to download. Even if theyre really small.
Here is my code for the handler
public class DownloadHandler : IHttpHandler { public void ProcessRequest(HttpContext context) { string path = ""; try { path = context.Server.UrlDecode(context.Request.QueryString["src"]).DecryptString(); } catch(Exception ex) { context.Response.Write(ex.Message); } System.IO.Stream iStream = null; byte[] buffer = new Byte[10000]; int length; long dataToRead; string filename = System.IO.Path.GetFileName(path); try { iStream = new System.IO.FileStream(context.Server.MapPath("~/" + path), System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read);
Hello everyone. I am having an issue downloading files that I have store in SQL Server. I have no problem in a WinForm. What am I doing wrong in my code?
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Response.Write("Downloading....") Dim sch As New clsReport Dim fileData As New clsReport.Letter fileData = sch.DownloadLetter(Session("LetterID")) Dim ms As System.IO.MemoryStream = fileData.fil Dim fil As Byte() = ms.ToArray Dim nam As String = fileData.name Dim ext As String = fileData.ext If Not fil Is Nothing Then Try ' Response.Clear() Response.AppendHeader("Content-Disposition", "attachment; filename=" + nam & "." & ext) ' Response.AddHeader("Content-Disposition", nam & "." & ext) Response.AddHeader("Content-Length", fil.Length.ToString) Response.ContentType = "Application/octet-stream" Response.Buffer = True Response.BinaryWrite(fil) Catch ex As Exception Response.Write(ex.Message) End Try End If End Su
I'm trying to build an BDC file that will pull information back from two tables in an Oracle database, I can import it without any errors, but then it tells me I do not have a filter when I try and select an item. When I add a filter I get an error when I import the file. The error I get is the following. "Application definition import failed. The following error occurred: The IdentifierName Attribute of the TypeDescriptor named 'TestDate' of the Parameter named ':TestDate' of the Method named 'Get_TestTwelve_List' of the Entity named 'TestTwelve' does not match any of the defined Identifiers for the Entity. Error was encountered at or just before Line: '133' and Position: '16'."
Here is the section of
<Property Name="RdbCommandText" Type="System.String"><![CDATA[ reading excel file problem Hi,i have 200 rows in my excel file. im using OleDbConnection to read the excel file.The problem is that it will read all the blank rows from row 200 onwards. Is there a configuration im missing ? or is there a way to import all rows that has data? Here's some of my code.string excelConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + filePath + ";" + "Extended Properties=Excel 8.0"; OleDbConnection excelConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filePath + ";Extended Properties='Excel 8.0;HDR=NO'"); OleDbCommand cmd = new OleDbCommand("Select * from [list$]",excelConnection);
Hi,
i have 200 rows in my excel file. im using OleDbConnection to read the excel file.
The problem is that it will read all the blank rows from row 200 onwards. Is there a configuration im missing ? or is there a way to import all rows that has data? Here's some of my code.
string excelConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + filePath + ";" + "Extended Properties=Excel 8.0"; OleDbConnection excelConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filePath + ";Extended Properties='Excel 8.0;HDR=NO'"); OleDbCommand cmd = new OleDbCommand("Select * from [list$]",excelConnection);
I have a word document to be generated using ASP.Net/VB.net.
So I have a word document template saved as .mht file on the web server.
In my ASP.Net code,I read this mht file content and replace certain string line Description$$ with the actual description from the database.Then save this content as .doc file.
This works fine but shows a box symbol when I have smart quotes " (not this one as I cannot type it here.The double quote which you see in MS Word,the slanted double quote).
I dont know how to make my word doc generated, show the exact double quote as in MS word.
If any of you have any idea of this please reply.
Thank you
Hall of Fame Twitter Terms of Service Privacy Policy Contact Us Archives Tell A Friend