Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
hi every body I need help to create username and password with SQL server and I will validity for the user to change the username and password how to do that with c# ??
Posted 3-Feb-13 4:29am
Comments
Sandeep Mewara at 3-Feb-13 12:18pm
   
This is not a well framed question! We cannot work out what you are trying to do/ask from the post. Please elaborate and be specific.
Use the "Improve question" link to edit your question and provide better information.
abu- himade at 3-Feb-13 14:27pm
   
I am sorry I want to create form windows form application Contains two text box username and password those text box must be link with SQL server and Give the user the authority to change the user name and password
you get that?
milenalukic at 3-Feb-13 12:56pm
   
What have you tried so far?
abu- himade at 3-Feb-13 14:28pm
   
I am sorry I want to create form windows form application Contains two text box username and password those text box must be link with SQL server and Give the user the authority to change the user name and password
you get that?
Balamurugan1989 at 3-Feb-13 13:19pm
   
Do you want to retrive username and password from sql to c#???
abu- himade at 3-Feb-13 14:26pm
   
I am sorry I want to create form windows form application Contains two text box username and password those text box must be link with SQL server and Give the user the authority to change the user name and password
you get that?
Balamurugan1989 at 3-Feb-13 15:08pm
   
I have submitted my solution in step by step process.If you got it correct give your vote.
Balamurugan1989 at 4-Feb-13 6:24am
   
Have You Got The Solution...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You follow the below steps for this process,
1.Create two textboxes in design form.
2.In coding you need to follow the below process,
//Add this namespace
using System.Data.Sqlclient;
 
oledbconnection con;
oledbdatareader dr;
oledbcommand cmd;
 
//We need to write the connection string
con=new sqlconnection ("Data Source=  ;Integrated Security=   ;User Id=  ; Pwd=  '");
//Now rightclick the button and write the below coding
{
con.Open();
cmd = new SqlCommand("SELECT UserName ,pwd FROM [aaa] WHERE UserName='" + textBox1.Text + "' AND pwd='" + textBox2.Text + "'", con);
SqlDataReader dr = cmd.ExecuteReader();
string userText = textBox1.Text;
string passText = textBox2.Text;
if (dr.Read())
{
 
this.Hide();
ddd mp = new ddd();
mp.Show();
dr.Close();
con.Close();
}
}
If you are following the above steps you will get the output perfectly.
  Permalink  
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

If and ONLY if you are referring to a SQL Server user and not a Windows authentication user then you can use the TSQL command "create user" to manage the user on SQL Server.
 
Then it is a matter of doing the following
1. Create the code that calls "create user" (and associated other user TSQL)
2. Wrap in an API
3. Use that API in a user display such as a C# GUI or web API.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 363
1 OriginalGriff 354
2 George Jonsson 248
3 Shemeemsha RA 148
4 Animesh Datta 130
0 OriginalGriff 6,179
1 Sergey Alexandrovich Kryukov 5,616
2 CPallini 4,770
3 George Jonsson 3,400
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 4 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100