|
You're welcome.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I have 2 Excel files...
1. the original Excel file that was given to me to be converted to a dataset and so I could fill up the SQL Database.
2. the other is the one I retrieved from the database and then generated into an Excel document. used a similar procedure
to that of the tutorial here... a low-tech version of generating Excel files... using the XML spreadsheet style in one of the tutorials...
I open both Excel files (the original and generated excel file) and they look identical and they even contain the exact same data in each cells...
now here's the problem...I need to make a method that checks whether or not they're equivalent or not to see if any data is lost since checking each
cell of a large excel file would take a lot of time...
so I use OleDB that comes with C# Express since we're not suppose to use any 3rd party dlls...
for a temporary method to test whether they're equal is, I try to convert the 2 excel documents to 2 datasets and then compare the two generated datasets
whether or not they are equivalent to each other...
public static DataSet Method()
{
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=FILE_PATH;Extended Properties=""Excel 8.0;HDR=YES;""";
OleDbConnection conn = new OleDbConnection(connectionString);
OleDbCommand cmd = new OleDbCommand("Select * from [Project List$]", conn);
cmd.CommandType = CommandType.Text;
OleDbDataAdapter myAdapter = new OleDbDataAdapter(cmd);
DataSet ds = new DataSet();
try
{
myAdapter.Fill(ds);
return ds;
}
catch(OleDbException ex)
{
throw ex;
}
}
the original converts to a dataset with no problem but when I try to convert the one generated from the database is catches an OleDbException...
OleDBException was caught:
External table is not in the expected format.
how come? and is there any word around to this problem without using any 3rd party dlls? or downloading any additional dlls from Microsoft?
so we tried another method... used XmlDocument to get the dataset... and then compared it to one another and yet they were not equal? any suggestions?
|
|
|
|
|
You are getting the exception because the excel file is in xml format. It should be in native xls file format for OleDb to work. You can use Excel object model to convert the xml file to excel format. I have described it here: Excel[^]
|
|
|
|
|
I get the following error message when trying to run my tests (ctrl-shift-X) :
"column 'TestType' does not belong to table test".
Has anyone found a workaround for this ?
-- modified at 4:07 Monday 10th September, 2007
Johan Lombaard
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein
|
|
|
|
|
This seems to be an issue with TFS (and possibly the testrun.config file0. To work round it, create a new test project and run with that.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks Pete. I tried that, but I still get the stupid message
Johan Lombaard
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein
|
|
|
|
|
Are you running the tests on Vista? There seems to be some issues with this.
I got the answer to my problem on this[^] thread.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I'm running it on XP.
I tried : Create new C# test project, reload, no joy.
Then : Create VB test project, reload original C# project, joy.
Wierd
Johan Lombaard
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein
|
|
|
|
|
The problem is when I close the port my program hangs. When I close the serial port, or the form, my program throws an exception, after hanging for a while.
Basically it hangs whenever I call SerialPort.Close();
Help would be greatly appreciated
|
|
|
|
|
can you post some code? do you have any program loops reading input from the port? what is the error exception.message?
If it' stuck, DO NOT pull harder!
|
|
|
|
|
Hi all,
Any one help me in .NET deployment. I am deploying an project which was created using c# 2005. In this i want to ask the user to enter for an serial key. I tried using the Custom information serail key option, but i feel that it's not good and more secured. I want to keep my own key as serial key and want to validate it. How to do this. plz giude me....
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
Need some clarity here, are you trying to come up with your own way of creating serial keys for your project?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi All
I need a DLL for convert PDF to Image
It is very urgent
Sakthi
|
|
|
|
|
Hi,
I would like to know what language should i use to create a program that includes a search engine searching pdf files (or .rgo files(repligo)).
for example,
pdf file has 9 pages. pages are numbered 1 to 9, i enter 1 into search engine and the program displays pdf file's page 1.
Thanks for your help
Regards
|
|
|
|
|
I am getting some serial inputs and storing them into a buffer when I want to place the contents onto the textbox from the buffer...a cross thread violation error comes up...I am running the textbox from the interrupt function of the serial comm. any advise?
Thanks
samuel
|
|
|
|
|
This should fix your problem...
<br />
public Form1()<br />
{<br />
<br />
InitializeComponent();<br />
<br />
CheckForIllegalCrossThreadCalls = false;<br />
}<br />
|
|
|
|
|
|
Wow that helps me alot... I have been having trouble with my GUI hanging...
Thanx!!!
|
|
|
|
|
Maybe you could edit your original reply where you suggest to disable the check? People who read it might not follow the link to the previous discussions and actually think they have found a solution. And as it often appears to work after a quick test they would be in the dark why their GUI hangs.
|
|
|
|
|
I'm working on WPF project in which I need to implement ZoomIn / ZoomOut on Scrollviewer object with seperate pan zoom window. There are two types of transformation which can be applied i.e. Layout Transform & Render Transform. Now the problem is I want to use the best of both kind of transformation.
I have a pan zoom window which shows the view of my scroll viewer object.When the view of my scrollviewer object changes i notify to pan zoom window to reflect the view of scroll viewer object.
For transformation, scrollviewer object's three properties are important. ViewPortSize, ExtentSize and Offset. When ZoomIn is performed, ViewPortSize and ExtentSize remains same in both Layout and Render transformation while Offset value gets changed in layout transform but in Render transform scrollviewer object's offset value is not changing. Because of this in render transform, even if the view(or layout) of my scrollviewer object in main canvas has changed still I can not send the changed information to pan zoom window (as offset value is same).
So my problem is my ZoomIn / ZoomOut related requirements are perfectly satisfied using Render Transform but if I use Render transform I can not update my view in Pan Zoom Window. Can any one suggest me the work around for this problem.
(I want to implement the zooming in the same way as implemented in Microsoft Visio. Pressing ctrl key n mouse wheel move wil provide the zooming operation in visio)
Below I'm pasting one link in which the problem described is I think somewhat related to my problem.
https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=991579&SiteID=1[^]
Hope I have been able to put up my question in proper way. Pls revert back in case more clarification needed. Thanks in advance.....
Krunal C
|
|
|
|
|
In the KeyDown event for my form, I have code that goes something like:
if (e.KeyCode == Keys.Right && e.Modifiers == Keys.Control)
{
textBox1.Focus();
textBox1.SelectAll();
}
So, when I press ctrl+right I'd like to focus on a text box and select all its text. But the right arrow press is processed by something else and so the cursor ends up at the end of the text box text with nothing selected. What's processing that right key press? How can I have ctrl+right select the text and not perform a right press in this one instance? Thanks for your help.
|
|
|
|
|
You can set e.Handled to true
|
|
|
|
|
Thanks again! I actually tried that before, must have made a mistake when testing it.
|
|
|
|
|
MSDN:
"Call the IsInputKey method to determine whether the key specified by the keyData parameter
is an input key that the control wants. This method is called during window message
preprocessing to determine whether the specified input key should be preprocessed or sent
directly to the control. If IsInputKey returns true, the specified key is sent directly to the
control. If IsInputKey returns false, the specified key is preprocessed and only sent to the
control if it is not consumed by the preprocessing phase. Keys that are preprocessed include
the TAB, RETURN, ESCAPE, and the UP ARROW, DOWN ARROW, LEFT ARROW, and RIGHT ARROW keys."
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Dudes,
Is it possible to show the data in datagridviewrow /datagridview using the dataset(not using the wizard).
ex.
DataSet ds;
ds = new DataSet();
... if it is. can you give me the order of codings.
thanks u so much,
jeof
******************************
I just want to
know everything
|
|
|
|