CREATE PROCEDURE [dbo].[sp_GetUserDetail] @userId INT AS BEGIN SELECT [dbo].[Account].[userName] AS 'User', [dbo].[Employee].[Email] AS 'Send Mail' FROM [dbo].[Account] INNER JOIN [dbo].[Employee] ON [dbo].[Employee].[User_Id] = [dbo].[Account].[ID] WHERE [dbo].[Account].[ID] = @userId END
Con.open() SqlCommand cmd = new SqlCommand("sp_GetUserDetail", con)
SqlConnection con = new SqlConnection("Data Source=ghrt\\se=CSharpUserLogin; Integrated Security=true"); con.Open(); SqlCommand cmd = new SqlCommand("sp_GetUserDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@userId" , '"+txtId.Text+"' )); SqlDataAdapter sda = new SqlDataAdapter(); sda.SelectCommand = cmd; DataTable dt = new DataTable(); sda.Fill(dt); BindingSource bs = new BindingSource(); bs.DataSource = dt; dgvEmployee.DataSource = bs; sda.Update(dt);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)