|
I use VB.NET 2005 and SQL Server 2005.
I use a GridView and a SQLDataSource.
I set the DatasorceID property of GridView and set the SQLDataSource to a Select statment that is executes in a stored procedure but GridView isn't bind to the data in table
What is the solution?
Thanks.
|
|
|
|
|
I use SQL Server 2005 and VB.NET 2005
I have a Project table and I use this stored procedure
CREATE PROCEDURE Insert_Project
-- Add the parameters for the stored procedure here
(@pNumber_M int,
@pRow_Agreement int,
@pRow_Machine int,
@pRow_Language int)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
BEGIN TRY
DECLARE @Number_O int;
SELECT @Number_O=Number-sum(Number_A) FROM Machine_View WHERE Row=@pRow_Machine GROUP BY Number
SET @Number_O=@Number_O-@pNumber_M;
INSERT INTO Project
(Number_A,Number_D,Row_Agreement,Row_Machine,Row_Language)
VALUES
(@pNumber_M,@Number_O,@pRow_Agreement,@pRow_Machine,@pRow_Language)
UPDATE Project
SET Number_D=@Number_O
WHERE Row_Machine=@pRow_Machine
END TRY
BEGIN CATCH
SELECT ERROR_PROCEDURE() AS ErrorProcedure;
END CATCH
END
GO
primery key is specified by Identity property in the project table
this stored procedure is successfully create but in runtime I have problem and any value dose not inserted in the table.
Thank you.
|
|
|
|