CREATE PROCEDURE [dbo].[GetOutletInfo] @PermitID int AS SELECT * FROM Outlets WHERE PermitID=@PermitID GO
var cn = new SqlConnection(connectionString); SqlDataAdapter da; DataSet ds = new DataSet(); da = new SqlDataAdapter("GetOutletInfo", cn); da.SelectCommand.CommandType = CommandType.StoredProcedure; da.SelectCommand.Parameters.Add("@PermitID", SqlDbType.Int).Value = PermitID; da.Fill(ds, "GetOutletInfo");
This query works (since it does not need a parameter) SqlDataAdapter da; DataSet ds = new DataSet(); da = new SqlDataAdapter("GetInspectionLettersQueue", cn); da.SelectCommand.CommandType = CommandType.StoredProcedure; da.Fill(ds, "GetInspectionLettersQueue");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)