Click here to Skip to main content
15,900,511 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problem when starting Windows Phone 7 Emulator Pin
nstk28-May-11 3:09
nstk28-May-11 3:09 
GeneralRe: Problem when starting Windows Phone 7 Emulator Pin
Mark Salsbery28-May-11 5:42
Mark Salsbery28-May-11 5:42 
GeneralRe: Problem when starting Windows Phone 7 Emulator Pin
nstk28-May-11 21:41
nstk28-May-11 21:41 
QuestionDataReader To DataTable Pin
Alexandra - Marie Schembri26-May-11 1:22
Alexandra - Marie Schembri26-May-11 1:22 
AnswerRe: DataReader To DataTable Pin
Blue_Boy26-May-11 1:28
Blue_Boy26-May-11 1:28 
AnswerRe: DataReader To DataTable [modified] Pin
Luc Pattyn26-May-11 1:41
sitebuilderLuc Pattyn26-May-11 1:41 
AnswerRe: DataReader To DataTable Pin
PIEBALDconsult26-May-11 2:51
mvePIEBALDconsult26-May-11 2:51 
AnswerRe: DataReader To DataTable Pin
Dhyanga26-May-11 4:43
Dhyanga26-May-11 4:43 
try this:
try
{

	SqlConnection conn = new SqlConnection("");	 
	conn = DataHandler.conn;	 
	String username = txtUsername.Text;
	String password = txtPassword.Text;
	SqlCommand cmd = new SqlCommand("SELECT * FROM [TBLUsers]", conn);
	conn.Open();
	DataTable table = new DataTable();
	SqlDataReader reader = null;
	reader = cmd.ExecuteReader();
	while (reader.Read())
	{
		if (txtUsername.Text == (reader["UserName"].ToString()) && txtPassword.Text = reader["Password"].ToString()))
		{
			table.Load(reader);
			POS2 p = new POS2();
			MainPage page = (MainPage)this.MdiParent;
			p.MdiParent = page;
			p.WindowState = FormWindowState.Maximized;
			p.Show();
			page.WelcomeUser = reader["UserName"].ToString();
			 
			//throw new CustomException("Enter Correct Username and Password");

		}
	}
}
catch
{
	reader.Dispose();
}
finally
{
	conn.close();
}

suchita

GeneralRe: DataReader To DataTable Pin
Luc Pattyn26-May-11 5:31
sitebuilderLuc Pattyn26-May-11 5:31 
GeneralRe: DataReader To DataTable Pin
Dhyanga26-May-11 6:13
Dhyanga26-May-11 6:13 
AnswerRe: DataReader To DataTable Pin
Luc Pattyn26-May-11 6:24
sitebuilderLuc Pattyn26-May-11 6:24 
GeneralRe: DataReader To DataTable Pin
Alexandra - Marie Schembri26-May-11 7:40
Alexandra - Marie Schembri26-May-11 7:40 
QuestionHow to consume XML Web Services with Parameters Pin
samir.abda25-May-11 17:27
samir.abda25-May-11 17:27 
AnswerRe: How to consume XML Web Services with Parameters Pin
Mark Salsbery25-May-11 18:50
Mark Salsbery25-May-11 18:50 
GeneralRe: How to consume XML Web Services with Parameters Pin
samir.abda25-May-11 21:16
samir.abda25-May-11 21:16 
GeneralRe: How to consume XML Web Services with Parameters Pin
Mark Salsbery25-May-11 21:27
Mark Salsbery25-May-11 21:27 
GeneralRe: How to consume XML Web Services with Parameters Pin
samir.abda25-May-11 21:51
samir.abda25-May-11 21:51 
QuestionRe: How to consume XML Web Services with Parameters Pin
Mark Salsbery25-May-11 22:03
Mark Salsbery25-May-11 22:03 
AnswerRe: How to consume XML Web Services with Parameters Pin
samir.abda25-May-11 22:19
samir.abda25-May-11 22:19 
GeneralRe: How to consume XML Web Services with Parameters [modified] Pin
Mark Salsbery25-May-11 22:27
Mark Salsbery25-May-11 22:27 
GeneralRe: How to consume XML Web Services with Parameters Pin
samir.abda25-May-11 22:46
samir.abda25-May-11 22:46 
QuestionRe: How to consume XML Web Services with Parameters Pin
Mark Salsbery26-May-11 11:07
Mark Salsbery26-May-11 11:07 
QuestionRe: How to consume XML Web Services with Parameters Pin
samir.abda26-May-11 14:10
samir.abda26-May-11 14:10 
AnswerRe: How to consume XML Web Services with Parameters Pin
Mark Salsbery26-May-11 14:15
Mark Salsbery26-May-11 14:15 
GeneralRe: How to consume XML Web Services with Parameters Pin
walterhevedeich26-May-11 20:17
professionalwalterhevedeich26-May-11 20:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.