|
|
Hi, i have a quick question. I have an application installed in a server that reads from Excel, is it necesary to have installed Excel so the application can read the excel files??
|
|
|
|
|
It depends on what you mean by "Excel files", and how they are being read.
If you mean comma separated value files (*.CSV) that a user might open in Excel, then no, you don't need Excel to read them.
If you mean files saved in the Excel format (*.xls), then the answer is "maybe", and you would need to give more information about the server-side component that reads the files. If it uses some form of MS Office automation (which would interop with the Excel runtime callable COM wrappers), then you would need at least some parts of Excel installed on the server.
However, if the server component is using the Jet database engine or some other proprietary driver(s) for accessing Excel, the requirement for installing Excel in and of itself is removed, however a new requirement may arise to support the component(s) reading the spreadsheets (Jet used to require some add-on components to intrepret Excel - don't know if they're a requirement any more, or if they are just installed automatically with Jet).
Hope this helps.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
I am using the jet database engine. I installed an excel viewer but still give me the error. The problem is that the error says: "No error information available: E_FAIL(0x80004005)"...What else could i try?
|
|
|
|
|
You did not previously indicate that you were having a problem or receiving any exception information, so it was a little difficult to give you specific advice.
I don't know what you mean by "Excel Viewer", but if you mean one of the GUI applications that allows viewing Office documents without having all of Office installed, it's unlikely to make a difference.
You need (to share) more information about the server-side component that's trying to read the Excel spreadsheets. As I mentioned before, your results are highly dependent upon what that component is doing. There is no way to give you any considered advice without knowing what the "reader" component is doing and how.
I can give you suggestions based upon the error number you're receiving, but they are not likely to yield much in the way of actual help - you can look up the error number (0x80004005) at:
http://support.microsoft.com[^]
There are numerous hits there, because the error number covers quite a bit of error-related real estate. The first item pertains to the Jet engine, and the fact that if connection properties are not correctly set (using, say, an OleDbConnection with Jet), then the specified error code might return, indicating a failure to find an ISAM.
Somewhere to start, anyway.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
This my string conexion:
strConection = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" l.xls@";Extended Properties=Excel 8.0;";
then i build the object:
OleDbConnection oConection = new OleDbConnection(strConection);
and open the conection:
oConexion.Open();--->HERE IS WHERE I GET THE RROR
In my server i have installed:
Microsoft Office Excel Viewer 2003
In my Data Sources(ODBC)
i have no USER DSN, SYSTEM DSN
In my drivers
I have Driver do Microsoft Excel (4.00.6200)
and Microsoft Excel Driver (4.00.6200)
What other information i can give u?
Thanks for all the help
|
|
|
|
|
Okay. First, put double-quotes around your Extended Properties value array. This requirement is not documented, but the lack of quotations around the Extended Properties will mess up the parsing of the connection string (nice, huh? Love those semicolons - the universal separator ) resulting in the exception you're seeing. See below for an example connection string that's confirmed working...
Now, if that doesn't do it:
I don't have a PC without Excel on it at the moment, but I did make a little sample application to read data from Excel spreadsheets. I used the connection string:
string connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"c:\\mydocument.xls\";Extended Properties=\"Excel 8.0;HDR=Yes;\"";
in my application. One difference is the addition of the HDR extended property. You could also alternately choose to use IMEX as an extended property, but I don't think they'd make a lot of difference, but might be worth a try:
"HDR=Yes;" indicates that the first row contains columnnames, not data
"IMEX=1;" tells the driver to always read "intermixed" data columns as text
Failing all other solutions to your exception problem, I would have to guess that your server has a damaged or missing Indexed Sequential Access Method (ISAM) driver for Excel.
There's an article here[^] that discusses how the Jet Db engine is used to access Excel workbooks.
Here[^] is a link dealing with how to repair missing/corrupted ISAM files.
I hope this helps - after this I've got nothing...
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Ok, ill try with this. Thanks for all ur time. Ill let u know what happened
|
|
|
|
|
Hello,
I have:
this.dataview.Table = this.dataset.Tables["CashFlow"];<br />
dataview.RowFilter = "VersionID = "+Convert.ToInt32(versionID);
When I am using foreach statement to iterate through the dataview table, I can see all the rows, even the ones that have VersionID not equal to versionID specified in the RowFilter property. I thought if you provide the filter, only rows visible in the dataview are the ones that will have proper VersionID. Any ideas what I am doing wrong?
Thank you
|
|
|
|
|
That should work. Are you sure you are iterating through the dataview and not the datatable? You should have something like:
<br />
foreach (DataRowView drv in dataview)<br />
{<br />
}<br />
Can you post your looping code?
|
|
|
|
|
Yes I am positive, here is the loop that I am using:
<br />
for (int i = 0; i < this.dataview.Table.Columns.Count; i++) {<br />
foreach (DataRow val in this.dataview.Table.Rows) {<br />
if (val["IndentLevel"].ToString() == level && val["VersionID"].ToString() == row["VersionID"].ToString()) {<br />
total = total + Convert.ToDecimal(val[i]);<br />
} <br />
}<br />
row[i] = total;<br />
total = 0;<br />
}
|
|
|
|
|
You are, in fact, looping through the rows in the table, not the rows in the dataview. DataView.Table is a reference to the original, unfiltered table. You must loop through the DataRowView objects in the DataView itself as I showed you in my previous post.
Try this:
<br />
for (int i = 0; i < this.dataview.Table.Columns.Count; i++) {<br />
foreach (DataRowView val in this.dataview) {<br />
if (val["IndentLevel"].ToString() == level && val["VersionID"].ToString() == row["VersionID"].ToString()) {<br />
total = total + Convert.ToDecimal(val[i]);<br />
} <br />
}<br />
row[i] = total;<br />
total = 0;<br />
}
|
|
|
|
|
Thank you very much.
I realised that I was looping through the unfiltered table.
|
|
|
|
|
I have a binary file.I want to read it as a String.I read it as array of chars and then copy to a String variable.Then I write a string to the new binary file.
But output file content is not equal to the input file.
ex:// 1.bin is not equal to 2.bin
BinaryReader br;
BinaryWriter bw;
BinaryWriter bw=new BinaryWriter(File.Open("c:\\1.bin", FileMode.Create ));
string str=null;
br=new BinaryReader(File.Open("c:\\2.bin", FileMode.Open ,FileAccess.Read));
char[] ChArray=br.ReadChars(200);
for (int i=0;i<200;i++)
{
str=str+ChArray[i];
}
bw.Write(str);
br.Close();
bw.Close();
|
|
|
|
|
|
You can't read a binary file as text. Read it as bytes instead.
---
b { font-weight: normal; }
|
|
|
|
|
To read a binary as an array of bytes (with a lot of help from turbochimp):
using System.IO;
byte[] buffer = null;
Stream file = new FileStream(@"C:\myfile.bin", FileMode.Open, FileAccess.Read);
buffer = new byte[file.Length];
file.Read(buffer, 0, (int)file.Length);
file.Close();
Now, all the file contents are in "buffer" and you can work with it.
Hope it helps you.
|
|
|
|
|
Where i can find any information about creating a vector drawing software, about technical, and algorithm?. Thank you very much
Nothing
|
|
|
|
|
|
I think it hard to catch the events of line, rectangle,... Do you know any project about it?
Nothing
-- modified at 19:52 Thursday 29th September, 2005
|
|
|
|
|
Hi All,
I'm totally stymied trying to deserialize an xml document to an object that I created in a dynamic assembly:
exception:
"Unable to generate a serializer for type Person from assembly <unknown> because the assembly may be dynamic. Save the assembly and load it from disk to use it with XmlSerialization."
Before I post a pile of code, I hoped someone might have an insight to this problem. I have tried saving the assembly to disk, then reloading it using System.AppDomain.Load(byte[] rawAssembly,byte[] rawSymbolStore) from reading the dynamic dll and pdb from disk...
Everything works (the assembly is loaded and the types I defined dynamically can be reflected) until I get to the point of declaring the xml serializer for my type...
Arg. Help.
Rein
|
|
|
|
|
|
There is hope
Alas, loading a string AssemblyName raises this exception:
"The located assembly's manifest definition with name 'DynMod' does not match the assembly reference."
What do you suppose I am missing?
Rein
|
|
|
|
|
ooops,
disregard that... was using a different name for the assembly than the module. They're the same name now and the error is gone.
Thanks again,
Rein
|
|
|
|
|
typical story, new to c# and got a, probably stupid, question!
I am trying to compile the code at http://www.codeproject.com/dotnet/pinvokeaddshare.asp
Its intended to create a file share.
When I run the code it throws a System.Security.SecurityException.
I put the responcible line in a try | catch block, just in case it was a problem with the code and checked exceptions.
I examined the code and the return from the method called in the erroring line returns a status code which says that the share was created but it was not.
I am an admin of the locel machine, which is where I am creating the share.
What I am thinking now is that Visual Studio executes code in a sandbox kind of arrangement and a security level has to be specified for executing code!!! does this feature exsits?
Any ideas?
Thanks
|
|
|
|