|
Hi.
By all means, you should continue to find out why the driver thinks it's a DOS program! But if the driver turns out to be inflexible, you can adapt the file name to the mangled "FILE~01.DBF" type of format.
I've been trying to post the code to you all day, but there's something about the message that causes the Code Project to time out. I'm reduced to hinting! It's a function in Kernel32 called GetShortPathName(), and I found the C# example myself using Google when I was in a similar situation. If you have trouble finding it, we can figure out some other way of getting you the code.
Hope this helps.
Evan
|
|
|
|
|
Hi Evan,
The ConnectionString i'm using to read *dbf files is "Provider=Microsoft.Jet.OLEDB.4.0; Data Source= " + directoryName +
"; Extended Properties=dBASE IV; User ID=; Password=;""
My current solution is copying that DBF file to temporary DBF file which has a legal name (length of filename <= 8), processing on the temporary file and deleting it after finishing.
If you have a better solution, Please let me know.
Thanks a lot.
|
|
|
|
|
[DllImport("Kernel32", CharSet = CharSet.Auto)]
static extern Int32 GetShortPathName(
String path,
StringBuilder shortPath,
Int32 shortPathLength);
public static string ConvertLongPathToShort(string longPathName)
{
StringBuilder shortNameBuffer;
int size;
shortNameBuffer = new StringBuilder();
size = GetShortPathName(longPathName, shortNameBuffer, shortNameBuffer.Capacity);
if(size >= shortNameBuffer.Capacity)
{
shortNameBuffer.Capacity = size + 1;
GetShortPathName(longPathName, shortNameBuffer, shortNameBuffer.Capacity);
}
return shortNameBuffer.ToString();
}
|
|
|
|
|
Your solution will work, though copying is extra effort. The solution I proposed is to get an 8.3 name from Windows. This name is a direct substitute for the long name of the file. It will have a tilde (~) character and a number in it, and can be used to access the DBF file you want.
I've had the darndest time putting in the code, and have found that it's possible to put in when the code is by itself, without a message. Therefore, the code for the function is separate.
Good luck.
Evan
|
|
|
|
|
Thanks Evan, this helps me much
|
|
|
|
|
Hi all,
My WebService WebMethod is returning DataSet. my wsdl content is like this
<NewDataSet xmlns="">
<ConsumerReport diffgr:id="ConsumerReport1" msdata:rowOrder="0">
<Initials>S</Initials>
<FirstName>S</FirstName>
<Surname>MVUNDURA</Surname>
<IDNo>7102095092182</IDNo>
<BirthDate>19710209T00:00:00.0000000+02:00</BirthDate>
<Gender>Male</Gender>
<TitleDesc>Mister</TitleDesc>
<ReferenceNo>T608575870</ReferenceNo>
<ExternalReference />
</ConsumerReport>
<ConsumerReport1 diffgr:id="ConsumerReport11" msdata:rowOrder="0">
<Initials>S</Initials>
<FirstName>S</FirstName>
<Surname>MVUNDURA</Surname>
<IDNo>7102095092182</IDNo>
<BirthDate>19710209T00:00:00.0000000+02:00</BirthDate>
<TitleDesc>Mister</TitleDesc>
<LastUpdatedDate>20061021T00:00:00.0000000+02:00</LastUpdatedDate>
</ConsumerReport1>
i need to display displayName node before the ConsumerReport node. like this...
<NewDataSet xmlns="">
<displayname>THIS IS CONSUMER PERSONAL INFORMATION</displayname>
<ConsumerReport diffgr:id="ConsumerReport1" msdata:rowOrder="0">
<Initials>S</Initials>
<FirstName>S</FirstName>
<Surname>MVUNDURA</Surname>
<IDNo>7102095092182</IDNo>
<BirthDate>19710209T00:00:00.0000000+02:00</BirthDate>
<Gender>Male</Gender>
<TitleDesc>Mister</TitleDesc>
<ReferenceNo>T608575870</ReferenceNo>
<ExternalReference />
</ConsumerReport>
<displayname>THIS IS CONSUMER TRACE ID INFORMATION</displayname>
<ConsumerReport1 diffgr:id="ConsumerReport11" msdata:rowOrder="0">
<Initials>S</Initials>
<FirstName>S</FirstName>
<Surname>MVUNDURA</Surname>
<IDNo>7102095092182</IDNo>
<BirthDate>19710209T00:00:00.0000000+02:00</BirthDate>
<TitleDesc>Mister</TitleDesc>
<LastUpdatedDate>20061021T00:00:00.0000000+02:00</LastUpdatedDate>
</ConsumerReport1>
How to Handle through the code. is there any method availble to add node in dataset?
please help me.
regards
GV Ramana Ramana</div>
|
|
|
|
|
Hi,
Im using C# ASP.Net here in the textbox i need to get the input as like follows
,any alphabet or any alphabet,any alphabet for example ,C or C,E like this i want to get the input.The textbox should get only one comma and it should not get any other special characters.it can be either by server side code or by the java script code..How should i do this any assistance plz..
rgrds
Kanna..
|
|
|
|
|
You can use the validator control and make a regular expression as per your requirement.
the benefit of this is that u r using the server side control but it works like the client side code.
|
|
|
|
|
Thanks for your reply.i had tried over that but i coudnt get any idea over there will u be clarify how to achieve that?
rgrds
Kanna
|
|
|
|
|
Hi,
Im using a datagridview which reacts on the enter key as on the tab
key. In other words, it moves to the next column instead of moving to
the next row. This works great for normal DataGridViewTextBoxCells. I
use derived classes from DataGridViewTextBoxCell,
DataGridViewTextBoxColumn and DataGridViewTextBoxEditingControl to
make that dream become reality. This works great
But now the tragedy...I have two DataGridViewComboBoxColumns in my
datagridview and unfortunatly it seems as if they behave a little
bitchy. If I enter such a DataGridViewComboBoxColumn and change into
the EditMode (by keystroke) and if I now want to leave it by pressing
the enter key it moves to the next row instead of moving to the next
column which is totally driving me insane.
Has anyone a solution how to fix that up? I thought I could build a
derived class for the DataGridViewComboBoxEditingControl to make that
work but havent found out how it actually works so far..any
suggestions would be greatly appreciated
best regards
Christoph
|
|
|
|
|
Hi,
How can I convert a report (.MAR) which was created in Microsoft Access to HTML in .Net?
I should be able to view a report which was created in Microsoft Access in Internet Explorer without having Microsoft Access to be installed on client's machine.
Note: My Access report contains some bar graphs etc other than text.
Thanks.
-- modified at 6:05 Tuesday 8th May, 2007
Subrahmanyam K
|
|
|
|
|
hi
i have a richText box that and a long text in it, i want to change color of my custom words in RichTextBox, but how to do ?
i don't want any class or dll or ... i want to know it's algorithm.
thanks
|
|
|
|
|
Have a look at SelectionColor of richtextbox
|
|
|
|
|
|
I am printing my Datatable to excel but I noticed when it reaches a certain number of rows it causes an exception.
Is there a limit to the number of DataTable rows that can be exported to a worksheet? If so, is there a way around this?
I am using Microsoft.Office.Interop.Excel.
Thanks in advance!
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
There is no such limit i guess, even if exists it is close to 65k i guess!
What is your row count?
Gautham
|
|
|
|
|
Sometimes more than 100K rows. If there is such a limit, I'm thinking of breaking up the resultset (DataTable) in multiple worksheets.
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
If that is acceptable by the end user then i would say it as a good solution
Gautham
|
|
|
|
|
How to check if the form is already open, so that it cannot be duplicatly openned
|
|
|
|
|
do it with the form load event that like this:
if (Process.GetProcessesByName(yourprocessname).Length >=1){
MessageBox.show("already opened!");
return;
}
|
|
|
|
|
I think he meant some form he has in his application, not the application itself
|
|
|
|
|
if that is like you said, that needs to use Mutex.
|
|
|
|
|
|
Thanks but my problem i want to close form1 before opening form2
|
|
|
|
|
Use singleton design pattern and it'll solve your problem
for example u want form1 to be checked if it's already opened
take a object of form1 with in your form1 class
make the constructor private of your form1 class
make a public static method
with in that method check if the object is null or not if null assign a new instance of your form1 and if not null then return the already initialized instance
|
|
|
|