Lost universe of Programing
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Lost universe of Programing

USERNAME :- Forum Post:-114
 
HomePortalGalleryLatest imagesRegisterLog in

 

 Data Base Connectivity With SQL Server 2000 using C#

Go down 
AuthorMessage
Administrator
Admin
Admin
Administrator


Male
Number of posts : 160
Age : 38
Location : Lucknow
Job/hobbies : Software Engeener
What U like To do ? : Because Its Rock with me.
Registration date : 2008-01-06

Data Base Connectivity With SQL Server 2000 using C# Empty
PostSubject: Data Base Connectivity With SQL Server 2000 using C#   Data Base Connectivity With SQL Server 2000 using C# I_icon_minitime3/1/2008, 7:09 pm

To Connect the Data base from the Sql server 2000, Using C# code, Changing the Password is as follows
Quote :

SqlConnection
Connection = new SqlConnection("Server = (local);Initial catalog = Intranet Application;Integrated security = sspi");
Connection.Open();
SqlCommand Command = new SqlCommand("sp_PasswordChange", Connection);
Command.CommandType =
CommandType.StoredProcedure;
Command.Parameters.Add(
new SqlParameter("@EmployCode", Txt_EmployCode.Text ));
Command.Parameters.Add(
new SqlParameter("@OldPassword", Txt_OldPassword.Text ));
Command.Parameters.Add(
new SqlParameter("@NewPassword", Txt_NewPassword.Text ));
DataSet Ds = new DataSet();
SqlDataAdapter Da = new SqlDataAdapter(Command);
Da.Fill(Ds);
To connect the .Net form through the Stored Procedure where Sp_PasswordChanger is the stored Procedure function or methord name.

Quote :
CREATE PROCEDURE [DBO].[sp_PasswordChange]
@EmployCode as Varchar(10),
@OldPassword as Varchar(16),
@NewPassword as Varchar(16)
AS
Declare @Employ_Code as varchar(10),
@output as integer
Select @Employ_Code = Employ_Code from Employ_Account where Employ_Code = @EmployCode and Password = @OldPassword
if(@Employ_Code = @EmployCode)
begin
Update Employ_Account set Password = @NewPassword Where Employ_Code = @EmployCode
Select @output= 1
End
Else
begin
Select @output = 0
End
select @output
GO

This is the Code for Stored Procedure For Changing the Password
Back to top Go down
https://aspx.forumotion.com
 
Data Base Connectivity With SQL Server 2000 using C#
Back to top 
Page 1 of 1
 Similar topics
-
» Extract Date From Date time data type in c#
» SQL SERVER 2000
» Tables in SQL SERVER 2000
» Extract Time From Date time data type in c#
» Extract Date From Date time data type in c#

Permissions in this forum:You cannot reply to topics in this forum
Lost universe of Programing :: --=| SOURCE CODE |=-- :: CODE FOR C# & ASP.NET-
Jump to: