how to collect all table name

how to collect all table name using C# or vb.net


Category: C# Tags: C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Web.UI.WebControls;
using System.Data;
using System.Windows;

public voidcollecttable(ListBox listname)
{
hookUp = new SqlConnection("Server=localhost\\SqlExpress;Database=gss;IntegratedSecurity=True");
hookUp.Open();
DataTable schema =hookUp.GetSchema("Tables");
listname.Items.Clear();
foreach (DataRow row in schema.Rows)
{
listname.Items.Add(row[2].ToString());
}
}



Like 1 Person
Published on 28 August 2013
Gurbachan

Gurbachan
Atricles: 1
Questions: 0
Given Best Solutions: 0 *

Reference:

self written

Comments:

No Comments Yet

You are not loggedin, please login or signup to add comments:

Existing User

Login via:

New User



x