Click here to Skip to main content
16,005,222 members
Home / Discussions / C#
   

C#

 
AnswerRe: Combo Box question Pin
Martin#11-Dec-06 0:57
Martin#11-Dec-06 0:57 
GeneralRe: Combo Box question Pin
Muntyness11-Dec-06 1:16
Muntyness11-Dec-06 1:16 
GeneralRe: Combo Box question Pin
Muntyness11-Dec-06 6:26
Muntyness11-Dec-06 6:26 
GeneralRe: Combo Box question Pin
Martin#11-Dec-06 9:49
Martin#11-Dec-06 9:49 
GeneralRe: Combo Box question [modified] Pin
Muntyness12-Dec-06 3:19
Muntyness12-Dec-06 3:19 
GeneralRe: Combo Box question Pin
Martin#12-Dec-06 5:43
Martin#12-Dec-06 5:43 
GeneralRe: Combo Box question Pin
Muntyness12-Dec-06 8:48
Muntyness12-Dec-06 8:48 
QuestionRow Count Problem while reading file using OLDEB connection pls help me Pin
dhanabalanr10-Dec-06 23:00
dhanabalanr10-Dec-06 23:00 
hi all,

I'm using oledb connection to read a dat file into dataset.
i've converted the dat file into txt file and created schema.ini file with |delimiter. It reads fine but my prob is no of rows count in the dataset is less than in the file(just only one row). Event i mentioned the hdr = no extended properties. Plz help

here i've given the sample code

public static DataSet FileReader(string Filename, bool SchemaRequired, DataSet dsCol)
{
string newFilename = "";
string filextn = Path.GetExtension(Filename).ToUpper();
string schemafile = "";
if(filextn == ".DAT")
{
// To change the File extension if the file type is DAT
newFilename = Path.ChangeExtension(Filename,"TXT");
File.Move(Filename,newFilename);
}
else
{
newFilename = Filename;
}
if(SchemaRequired)
{
//This Schema.ini file is required to read the text file with custom delimiters here we use(|)
schemafile = Path.GetDirectoryName(Filename)+@"\Schema.ini";
if(File.Exists(schemafile))
{
File.Delete(schemafile);
}
using(StreamWriter writer = File.CreateText(schemafile))
{
writer.WriteLine("["+Path.GetFileName(newFilename)+"]");
writer.WriteLine("Format = Delimited(|)");
for(int i = 1; i<= 19; i++)
writer.WriteLine("Col"+ i +"=C"+ i + " Text");
}
}
string PathtoTextFile = Path.GetDirectoryName(newFilename);
System.Data.OleDb.OleDbConnection oConn = new
System.Data.OleDb.OleDbConnection(
"Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + PathtoTextFile + ";" +
"Extended Properties=\"text;HDR=NO;FMT=Delimited\"");
System.Data.OleDb.OleDbDataAdapter oCmd = new System.Data.OleDb.OleDbDataAdapter(
"select * from "+Path.GetFileName(newFilename),oConn);
DataSet myDS = new DataSet();
try
{
oCmd.Fill(myDS);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
return null;
}
finally
{
if(SchemaRequired)
File.Delete(schemafile);
if(filextn == ".DAT")
{
Filename = Path.ChangeExtension(newFilename, "DAT");
File.Move(newFilename,Filename);
}
}
return myDS;
}
Question"exception handling" Pin
ravikiranreddydharmannagari10-Dec-06 22:59
ravikiranreddydharmannagari10-Dec-06 22:59 
AnswerRe: "exception handling" Pin
Pete O'Hanlon10-Dec-06 23:03
mvePete O'Hanlon10-Dec-06 23:03 
Question'CopyLocal' - Reference Property Pin
AJ12310-Dec-06 22:57
AJ12310-Dec-06 22:57 
Questionhow to display windows form chart inside webpage? Pin
Velerena_sam10-Dec-06 22:56
Velerena_sam10-Dec-06 22:56 
AnswerRe: how to display windows form chart inside webpage? Pin
karam chandrabose11-Dec-06 0:50
karam chandrabose11-Dec-06 0:50 
GeneralRe: how to display windows form chart inside webpage? Pin
Velerena_sam11-Dec-06 20:04
Velerena_sam11-Dec-06 20:04 
QuestionChanging a Column value in a DataRow Pin
Gareth H10-Dec-06 22:46
Gareth H10-Dec-06 22:46 
AnswerRe: Changing a Column value in a DataRow [modified] Pin
Gareth H12-Dec-06 0:27
Gareth H12-Dec-06 0:27 
QuestionRighthand mouse-click to a tree-view should act like a lefthand mouse-click Pin
Schmullus10-Dec-06 22:42
Schmullus10-Dec-06 22:42 
QuestionAVI to 3GP Conversion in C#.Net Pin
Abhilash K10-Dec-06 22:35
Abhilash K10-Dec-06 22:35 
AnswerRe: AVI to 3GP Conversion in C#.Net Pin
chris_do10-Dec-06 23:04
chris_do10-Dec-06 23:04 
Questionoffline web service programming? Pin
George_George10-Dec-06 21:54
George_George10-Dec-06 21:54 
AnswerRe: offline web service programming? Pin
Pete O'Hanlon10-Dec-06 23:06
mvePete O'Hanlon10-Dec-06 23:06 
GeneralRe: offline web service programming? Pin
George_George11-Dec-06 2:54
George_George11-Dec-06 2:54 
GeneralRe: offline web service programming? Pin
Pete O'Hanlon11-Dec-06 3:26
mvePete O'Hanlon11-Dec-06 3:26 
GeneralRe: offline web service programming? Pin
George_George11-Dec-06 3:32
George_George11-Dec-06 3:32 
GeneralRe: offline web service programming? Pin
Pete O'Hanlon11-Dec-06 4:45
mvePete O'Hanlon11-Dec-06 4:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.