string dbName = listBox1.SelectedItem.ToString(); string conxString_2 = "Data Source=LUKE-PC; Integrated Security=True; Initial Catalog=" + dbName + ""; using (SqlConnection sqlConx_2 = new SqlConnection(conxString_2)) { sqlConx_2.Open(); SqlCommand sqlcom = new SqlCommand(); sqlcom.Connection = sqlConx_2; sqlcom.CommandType = CommandType.StoredProcedure; sqlcom.CommandText = "select * from sys.objects where type='p' and is_ms_shipped=0 and [name] not like 'sp[_]%diagram%'"; SqlDataReader sqldr; sqldr = sqlcom.ExecuteReader(); while (sqldr.Read()) { listBox1.Items.Add(sqldr.GetString(0)); } }
Select * from sys.objects where type=’p’ and is_ms_shipped=0 and [name] not like ‘sp[_]%diagram%’
exec sp_stored_procedures
SELECT * FROM sys.procedures;
CommandType.StoredProcedure
CommandType.Text
CommandType.StoredProcudure
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)