Click here to Skip to main content
15,902,938 members
Home / Discussions / C#
   

C#

 
AnswerRe: MultiQC & QCFile-LinkA interfacing. Pin
danmol20-Sep-08 23:33
danmol20-Sep-08 23:33 
GeneralRe: MultiQC & QCFile-LinkA interfacing. Pin
danmol20-Sep-08 23:34
danmol20-Sep-08 23:34 
GeneralRe: MultiQC & QCFile-LinkA interfacing. Pin
Dinker Batra20-Sep-08 23:42
Dinker Batra20-Sep-08 23:42 
Questionretrieve a msaccess column description Pin
djjedi20-Sep-08 2:50
djjedi20-Sep-08 2:50 
AnswerRe: retrieve a msaccess column description Pin
Harvey Saayman20-Sep-08 9:47
Harvey Saayman20-Sep-08 9:47 
GeneralRe: retrieve a msaccess column description Pin
djjedi20-Sep-08 11:04
djjedi20-Sep-08 11:04 
GeneralRe: retrieve a msaccess column description Pin
Harvey Saayman20-Sep-08 11:12
Harvey Saayman20-Sep-08 11:12 
GeneralRe: retrieve a msaccess column description Pin
djjedi23-Sep-08 1:48
djjedi23-Sep-08 1:48 
I guess maybe im missing something.

im able to retrieve the tables using

private void GetTables()
{
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + DataBaseFile;
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(connectionString);
try
{
this.cboSections.Items.Clear();
conn.Open();
DataTable schemaTab =conn.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, new Object[] {null, null, null, "TABLE"});
DataTable schemaTable =conn.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, new Object[] {null, null, null, "TABLE"});

conn.Close();



for (int j = 0;j < schemaTable.Columns.Count; j++)
{
Console.WriteLine(schemaTable.Columns[j].ToString());
for (int i = 0; i < schemaTab.Rows.Count; i++)
{this.cboSections.Items.Add((schemaTab.Rows[i].ItemArray[2].ToString()));}
if (this.cboSections.Text.Equals(""))
this.cboSections.SelectedItem = this.cboSections.Items[0];
}
}
catch(Exception ex){Console.WriteLine(ex.Source);}
}


and im able to retrieve tthe columns im looking for using


private void GetColumns()
{
string TableName = this.cboSections.SelectedItem.ToString();
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + DataBaseFile ;
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(connectionString);
DataRowView drvCols = null;
DataTable dtCols = null;
DataView dvColumns = null;


// Get the list of tables that there are.
try
{
this.liFields.Items.Clear();
this.liValues.Items.Clear();
conn.Open();
DataTable schemaTab =
conn.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, new Object[] {null, null, null, "TABLE"});

for (int i = 0; i < schemaTab.Rows.Count; i++)
{
if (this.cboSections.Text.Equals(schemaTab.Rows[i].ItemArray[2]))
{
// Get the column name and its type and sort them
// according to their position in the table.
dtCols = conn.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Columns,new Object[]{null,null, schemaTab.Rows[i].ItemArray[2].ToString(), null});
dvColumns = new DataView(dtCols);
dvColumns.Sort = "ORDINAL_POSITION";

// Get the column names and their types.
for (int j=0; j< dvColumns.Count; j++)
{
// Get the name of the column.
drvCols = dvColumns[j];
if ((! drvCols.Row.ItemArray[3].ToString().Equals("ID") )&& (! drvCols.Row.ItemArray[3].ToString().Equals("")))
{
this.liFields.Items.Add(drvCols.Row.ItemArray[3].ToString());
this.liValues.Items.Add(ini.IniReadValue(cboSections.Text,drvCols.Row.ItemArray[3].ToString()));
}
}
}
}
}
catch(Exception ex){Console.WriteLine(ex.Source);}
conn.Close();
}

but im unable to get the descriptions for those columns.
QuestionHow to save with unique ID Pin
manju#12320-Sep-08 2:25
manju#12320-Sep-08 2:25 
AnswerRe: How to save with unique ID Pin
User 665820-Sep-08 2:39
User 665820-Sep-08 2:39 
GeneralRe: How to save with unique ID Pin
HosamAly20-Sep-08 3:42
HosamAly20-Sep-08 3:42 
AnswerRe: How to save with unique ID Pin
#realJSOP20-Sep-08 9:47
professional#realJSOP20-Sep-08 9:47 
QuestionDid the compiler inline my method? Pin
HosamAly20-Sep-08 2:05
HosamAly20-Sep-08 2:05 
AnswerRe: Did the compiler inline my method? Pin
User 665820-Sep-08 2:41
User 665820-Sep-08 2:41 
JokeRe: Did the compiler inline my method? Pin
Pete O'Hanlon20-Sep-08 3:28
mvePete O'Hanlon20-Sep-08 3:28 
GeneralRe: Did the compiler inline my method? Pin
User 665820-Sep-08 3:53
User 665820-Sep-08 3:53 
GeneralRe: Did the compiler inline my method? Pin
Paul Conrad20-Sep-08 10:33
professionalPaul Conrad20-Sep-08 10:33 
QuestionRe: Did the compiler inline my method? Pin
HosamAly20-Sep-08 3:30
HosamAly20-Sep-08 3:30 
AnswerRe: Did the compiler inline my method? Pin
User 665820-Sep-08 4:00
User 665820-Sep-08 4:00 
AnswerRe: Did the compiler inline my method? Pin
Guffa20-Sep-08 4:37
Guffa20-Sep-08 4:37 
GeneralRe: Did the compiler inline my method? Pin
HosamAly20-Sep-08 4:47
HosamAly20-Sep-08 4:47 
GeneralRe: Did the compiler inline my method? Pin
Guffa20-Sep-08 13:17
Guffa20-Sep-08 13:17 
QuestionEasy to learn WSDL and SOAP tutorial Pin
George_George20-Sep-08 1:26
George_George20-Sep-08 1:26 
Questionchecking who is online in gmail in c# Pin
Mogaambo20-Sep-08 1:16
Mogaambo20-Sep-08 1:16 
AnswerRe: checking who is online in gmail in c# Pin
Harvey Saayman20-Sep-08 9:50
Harvey Saayman20-Sep-08 9:50 

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.