USE YourDBName GO SELECT * FROM sys.Tables GO
IF EXISTS(SELECT * FROM SYSOBJECTS WHERE name = 'tablename' AND xtype = 'U')
SqlConnection conn = new SqlConnection(); conn.ConnectionString = "Ur Connection String"; conn.Open(); string strCommand = "SELECT * FROM INFORMATION_SCHEMA.TABLES where table_type!='View' and table_name!='sysdiagrams'"; SqlCommand cmd = new SqlCommand(strCommand, conn); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); foreach (DataRow dr in dt.Rows) { if (dr[2] != YourTextBox.Text) { Response.Write("Table not exist"); } } cmd.Dispose(); conn.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)