M.Nabeel Siddiqui
Запишите имя таблицы хранимых процедур, например: MoodleUsersTable
use Sample
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <m.nabeel siddiqui="">
-- Create date: <19/4/2016>
-- Description: <adding records="" in="" moodleusers="">
-- =============================================
Alter PROCEDURE InsertMoodleUsers
@MoodleUserTable MoodleUsersTable readonly
AS
BEGIN
insert into MoodleUsers select * from @MoodleUserTable
END
GO</adding></m.nabeel>
и код c# здесь
public void runsp(DataTable dt1,string spName)
{
SqlCommand cmd = new SqlCommand(spName, connection);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter dtparam = cmd.Parameters.AddWithValue("@MoodleUserTable", dt1);
dtparam.SqlDbType = SqlDbType.Structured;
Start();
cmd.ExecuteNonQuery();
Stop();
}