View Complete Post
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);
DataTable dtTables = conn.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, null);
string strTablename = dtTables.Rows["TABLE_NAME"].ToString();
string strSQL = "SELECT * FROM [" + strTablename + "]";
OleDbCommand cmd = new OleDbCommand(strSQL, conn);
DataTable dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
//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
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 = "";
path = context.Server.UrlDecode(context.Request.QueryString["src"]).DecryptString();
System.IO.Stream iStream = null;
byte buffer = new Byte;
string filename = System.IO.Path.GetFileName(path);
iStream = new System.IO.FileStream(context.Server.MapPath("~/" + path), System.IO.FileMode.Open,
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
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
Response.AppendHeader("Content-Disposition", "attachment; filename=" + nam & "." & ext)
' Response.AddHeader("Content-Disposition", nam & "." & ext)
Response.ContentType = "Application/octet-stream"
Response.Buffer = True
Catch ex As Exception
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 =
"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.