Click here to Skip to main content
15,895,142 members
Home / Discussions / C#
   

C#

 
AnswerRe: Wiewing Office Document in Web Browser Pin
dan!sh 6-Aug-09 20:00
professional dan!sh 6-Aug-09 20:00 
GeneralRe: Wiewing Office Document in Web Browser Pin
Baeltazor7-Aug-09 0:29
Baeltazor7-Aug-09 0:29 
QuestionHow to catch the data that is given for print using c# Pin
svt gdwl6-Aug-09 19:40
svt gdwl6-Aug-09 19:40 
Questionhow to get tables of an access db into a list box using c#? Pin
fathatsme6-Aug-09 19:04
fathatsme6-Aug-09 19:04 
AnswerRe: how to get tables of an access db into a list box using c#? Pin
Cracked-Down6-Aug-09 19:24
Cracked-Down6-Aug-09 19:24 
QuestionRe: how to get tables of an access db into a list box using c#? Pin
fathatsme6-Aug-09 19:33
fathatsme6-Aug-09 19:33 
Answerhow to get fields tables of an acces db into a list box?` Pin
fathatsme6-Aug-09 20:16
fathatsme6-Aug-09 20:16 
GeneralRe: how to get fields tables of an acces db into a list box?` Pin
fathatsme6-Aug-09 23:36
fathatsme6-Aug-09 23:36 
i need to make 3 list boxes!!

1st one to display the table names of the db<-----done till here!!!!


2nd to display field names when clicked on table name!!!<-----done till here!!!!



3rd to display attributes of the fields on clickin on it!!!---> to b done!

4.v shud b able to edit the attribute values and on clickin of save button it should update the database!!! ---> to b done!


this is my code so far!!!


.
.


public partial class Form1 : Form

{

private OleDbConnection cn = new OleDbConnection();

private DataTable schemaTable;

public Form1()

{

InitializeComponent();

cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Mode=Share Deny None;Data Source=";

}

private void button1_Click(object sender, EventArgs e)

{

cn.Close();

cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Mode=Share Deny None;Data Source=";

listBox1.Items.Clear();

listBox2.Items.Clear();

OpenFileDialog oDlg = new OpenFileDialog();

string strFileName = "";

oDlg.Title = "Select MDB";

oDlg.Filter = "MDB (*.Mdb)|*.mdb";

oDlg.RestoreDirectory = true;

string dir = Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);

oDlg.InitialDirectory = dir;

DialogResult result = oDlg.ShowDialog();

if (result == DialogResult.OK)

{

strFileName = oDlg.FileName.ToString();

textBox1.Text = strFileName;

}

cn.ConnectionString += strFileName;

cn.Open();

schemaTable = cn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,

new Object[] { null, null, null, "TABLE" });

//List the table name from each row in the schema table.

for (int i = 0; i < schemaTable.Rows.Count; i++)

{

string strTableName = schemaTable.Rows[i].ItemArray[2].ToString();

listBox1.Items.Add(strTableName);

}

}

private void listBox1_SelectedIndexChanged(object sender, EventArgs e)

{

listBox2.Items.Clear();

string strTableName = listBox1.SelectedItem.ToString();

schemaTable = cn.GetOleDbSchemaTable(OleDbSchemaGuid.Columns,

new Object[] { null, null, strTableName, null });

//List the column name from each row in the schema table.

for (int i = 0; i < schemaTable.Rows.Count; i++)

{

string strColName = schemaTable.Rows[i].ItemArray[3].ToString();

listBox2.Items.Add(strColName);

}

}

private void button3_Click(object sender, EventArgs e)

{

Application.Exit();

}

private void listBox2_SelectedIndexChanged(object sender, EventArgs e)

{

listBox3.Items.Clear();

string strTableName = listBox1.SelectedItem.ToString();

schemaTable = cn.GetOleDbSchemaTable(OleDbSchemaGuid.Columns,

new Object[] { null, null, strTableName, null });

//List the column name from each row in the schema table.

for (int i = 0; i < schemaTable.Rows.Count; i++)

{

string strColItm = schemaTable.Rows[i].ItemArray[4].ToString();

listBox2.Items.Add(strColItm);

}

}

}
QuestionDataGridView Pin
vhassan6-Aug-09 18:26
vhassan6-Aug-09 18:26 
AnswerRe: DataGridView Pin
Mycroft Holmes6-Aug-09 20:14
professionalMycroft Holmes6-Aug-09 20:14 
Questionon enter fire button Pin
Rajee Maharjan6-Aug-09 18:26
Rajee Maharjan6-Aug-09 18:26 
AnswerRe: on enter fire button Pin
MumbleB6-Aug-09 19:19
MumbleB6-Aug-09 19:19 
AnswerRe: on enter fire button Pin
Cracked-Down6-Aug-09 19:21
Cracked-Down6-Aug-09 19:21 
AnswerRe: on enter fire button Pin
Rajee Maharjan6-Aug-09 19:51
Rajee Maharjan6-Aug-09 19:51 
AnswerRe: on enter fire button Pin
DaveyM696-Aug-09 21:29
professionalDaveyM696-Aug-09 21:29 
QuestionHow to save the property of the user-defined column ? Pin
mctramp1686-Aug-09 17:39
mctramp1686-Aug-09 17:39 
AnswerRe: How to save the property of the user-defined column ? Pin
N a v a n e e t h6-Aug-09 18:07
N a v a n e e t h6-Aug-09 18:07 
Questionworking with webservices in .net Pin
prasadbuddhika6-Aug-09 17:12
prasadbuddhika6-Aug-09 17:12 
AnswerRe: working with webservices in .net Pin
N a v a n e e t h6-Aug-09 17:47
N a v a n e e t h6-Aug-09 17:47 
GeneralRe: working with webservices in .net Pin
prasadbuddhika6-Aug-09 19:27
prasadbuddhika6-Aug-09 19:27 
GeneralRe: working with webservices in .net Pin
N a v a n e e t h6-Aug-09 22:26
N a v a n e e t h6-Aug-09 22:26 
QuestionSend SMS /MMS to mobile phone from FTP server Pin
pearllyn6-Aug-09 15:46
pearllyn6-Aug-09 15:46 
AnswerRe: Send SMS /MMS to mobile phone from FTP server Pin
Spacix One6-Aug-09 17:28
Spacix One6-Aug-09 17:28 
AnswerRe: Send SMS /MMS to mobile phone from FTP server Pin
Blue_Boy7-Aug-09 3:41
Blue_Boy7-Aug-09 3:41 
QuestionSaving RSS feed in "utf-8" format. Pin
dbhalla_in6-Aug-09 14:29
dbhalla_in6-Aug-09 14:29 

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.