با عرض سلام و خسته نباشید خدمت کاربران وب سایت پروگرم 98 😉 در این پست کد گرفتن داده به وسیله SQL Server Stored Procedure در سی شارپ #C را آماده کردم. انشاالله که این کد سی شارپ براتون مفید باشد.
کد گرفتن داده به وسیله SQL Server Stored Procedure در سی شارپ #C :
using System;
using System.Data;
using System.Data.SqlClient;
class Program
{
static void Main(string[] args)
{
string sqlConnectString = "Data Source=(local);Integrated security=SSPI;Initial Catalog=AdventureWorks;";
string sqlSelect = "uspGetEmployeeManagers";
SqlConnection connection = new SqlConnection(sqlConnectString);
SqlCommand command = new SqlCommand(sqlSelect, connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@EmployeeID", SqlDbType.Int).Value = 100;
DataTable dt = new DataTable( );
using System.Data;
using System.Data.SqlClient;
class Program
{
static void Main(string[] args)
{
string sqlConnectString = "Data Source=(local);Integrated security=SSPI;Initial Catalog=AdventureWorks;";
string sqlSelect = "uspGetEmployeeManagers";
SqlConnection connection = new SqlConnection(sqlConnectString);
SqlCommand command = new SqlCommand(sqlSelect, connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@EmployeeID", SqlDbType.Int).Value = 100;
DataTable dt = new DataTable( );