created a stored procedure in ssms 2019
which ran find and I see my procedure in ssms, but when i go to test i get this when trying to pull up the sql data in a listbox
System.Data.SqlClient.SqlException: 'Could not find stored procedure '/*usp_Close*/'.'
the code for the listbox is as
so not sure what I did wrong yet
C#:
CREATE PROCEDURE usp_Close
AS
BEGIN
SELECT [closeid], [e_date]
FROM [dbo].[close1]
END
which ran find and I see my procedure in ssms, but when i go to test i get this when trying to pull up the sql data in a listbox
System.Data.SqlClient.SqlException: 'Could not find stored procedure '/*usp_Close*/'.'
the code for the listbox is as
C#:
private DataTable GetData()
{
DataTable Close = new DataTable();
string connectionString = ConfigurationManager.ConnectionStrings["VersiReports_V1.Properties.Settings.versiposConnectionString"].ConnectionString;
using (SqlConnection conn = new SqlConnection(connectionString))
{
using (SqlCommand cmd = new SqlCommand("/*usp_Close*/", conn))
{
cmd.CommandType = System.Data.CommandType.StoredProcedure;
conn.Open();
SqlDataReader reader = cmd.ExecuteReader();
Close.Load(reader);
}
so not sure what I did wrong yet