Click here to Skip to main content
15,899,314 members
Home / Discussions / Database
   

Database

 
AnswerRe: MySQL slow inserting 10,000+ records Pin
Mike Dimmick6-Mar-07 2:06
Mike Dimmick6-Mar-07 2:06 
GeneralRe: MySQL slow inserting 10,000+ records Pin
jds12076-Mar-07 3:44
jds12076-Mar-07 3:44 
QuestionAgain Remote Access Pin
alexrad5-Mar-07 1:08
alexrad5-Mar-07 1:08 
AnswerRe: Again Remote Access Pin
Hesham Amin5-Mar-07 3:05
Hesham Amin5-Mar-07 3:05 
GeneralRe: Again Remote Access Pin
alexrad5-Mar-07 4:39
alexrad5-Mar-07 4:39 
QuestionDynamic Filters Pin
Sam Heller5-Mar-07 1:06
Sam Heller5-Mar-07 1:06 
AnswerRe: Dynamic Filters Pin
alexrad5-Mar-07 1:13
alexrad5-Mar-07 1:13 
GeneralRe: Dynamic Filters Pin
Sam Heller5-Mar-07 1:16
Sam Heller5-Mar-07 1:16 
GeneralRe: Dynamic Filters Pin
alexrad5-Mar-07 1:26
alexrad5-Mar-07 1:26 
GeneralRe: Dynamic Filters Pin
Sam Heller5-Mar-07 1:33
Sam Heller5-Mar-07 1:33 
AnswerRe: Dynamic Filters Pin
alexrad5-Mar-07 1:40
alexrad5-Mar-07 1:40 
GeneralRe: Dynamic Filters Pin
Sam Heller5-Mar-07 2:09
Sam Heller5-Mar-07 2:09 
GeneralRe: Dynamic Filters Pin
Pete O'Hanlon5-Mar-07 4:21
mvePete O'Hanlon5-Mar-07 4:21 
GeneralRe: Dynamic Filters Pin
Sam Heller5-Mar-07 4:28
Sam Heller5-Mar-07 4:28 
GeneralRe: Dynamic Filters Pin
alexrad5-Mar-07 4:36
alexrad5-Mar-07 4:36 
GeneralRe: Dynamic Filters Pin
Sam Heller5-Mar-07 4:37
Sam Heller5-Mar-07 4:37 
GeneralRe: Dynamic Filters Pin
alexrad5-Mar-07 4:41
alexrad5-Mar-07 4:41 
GeneralRe: Dynamic Filters Pin
Pete O'Hanlon5-Mar-07 4:41
mvePete O'Hanlon5-Mar-07 4:41 
GeneralRe: Dynamic Filters Pin
alexrad5-Mar-07 4:43
alexrad5-Mar-07 4:43 
QuestionTrusted connection Pin
alexrad4-Mar-07 14:13
alexrad4-Mar-07 14:13 
AnswerRe: Trusted connection Pin
Mark J. Miller8-Mar-07 6:35
Mark J. Miller8-Mar-07 6:35 
QuestionHow to get the Table Name and Total Row Numbers? [modified] Pin
Khoramdin4-Mar-07 9:57
Khoramdin4-Mar-07 9:57 
Hello everyone,

I am trying to get the list of table in a Database and the total number of rows in each table. I have created the loop which loops and get the Table names. I have problem getting the total number of rows for each table in the Database. I successfully get the Table's name but once it comes to getting the total number of the row, I get problem. I am not sure if I can use the Odbc[0] once again to get the total number of the row since it is in use for the loop to get the Table's name.

My code is:

OdbcCom = new System.Data.Odbc.OdbcCommand("USE " + DataBaseName + ";", OdbcCon);
OdbcDR = OdbcCom.ExecuteReader();
OdbcCom = new System.Data.Odbc.OdbcCommand("SHOW TABLES;", OdbcCon);
OdbcDR = OdbcCom.ExecuteReader();
txtLog.AppendText("Tables inside " + DataBaseName + ":\r\n");
while (OdbcDR.Read())
{
txtLog.AppendText(">> " + OdbcDR[0] + "\r\n");
ListViewItem item1 = new ListViewItem(OdbcDR[0].ToString());

MessageBox.Show("Table name:" + OdbcDR[0].ToString());

// START COUNT
OdbcCom = new System.Data.Odbc.OdbcCommand("SELECT COUNT(*) FROM " + OdbcDR[0].ToString() + ";", OdbcCon);
OdbcDR = OdbcCom.ExecuteReader();

// What should I put to get the return value "Total row number" in here?
item1.SubItems.Add("Need to add the total number of rows here!");
// END COUNT

listView1.Items.Add(item1);
}

Could you be kind enough to help me out on this one? Thank you very much and have a great day.

Khoramdin




-- modified at 16:16 Sunday 4th March, 2007
AnswerRe: How to get the Table Name and Total Row Numbers? Pin
mr_lasseter4-Mar-07 11:11
mr_lasseter4-Mar-07 11:11 
Questionscript DB Pin
Mridang Agarwalla4-Mar-07 4:06
Mridang Agarwalla4-Mar-07 4:06 
AnswerRe: script DB Pin
Harini N K4-Mar-07 19:24
Harini N K4-Mar-07 19:24 

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.