Click here to Skip to main content
15,891,375 members
Home / Discussions / C#
   

C#

 
GeneralRe: creating a GUID for a file Pin
Nick Parker6-Mar-04 4:29
protectorNick Parker6-Mar-04 4:29 
GeneralRe: creating a GUID for a file Pin
Dave Kreskowiak6-Mar-04 5:54
mveDave Kreskowiak6-Mar-04 5:54 
GeneralRe: creating a GUID for a file Pin
Heath Stewart6-Mar-04 17:44
protectorHeath Stewart6-Mar-04 17:44 
GeneralRe: creating a GUID for a file Pin
Dave Kreskowiak7-Mar-04 5:21
mveDave Kreskowiak7-Mar-04 5:21 
GeneralHelp ! DOS 8.3 File Name to Full Path Pin
Andy Hampshire5-Mar-04 22:18
Andy Hampshire5-Mar-04 22:18 
GeneralRe: Help ! DOS 8.3 File Name to Full Path Pin
Nick Parker6-Mar-04 8:48
protectorNick Parker6-Mar-04 8:48 
GeneralRe: Help ! DOS 8.3 File Name to Full Path Pin
Andy Hampshire8-Mar-04 4:19
Andy Hampshire8-Mar-04 4:19 
GeneralPassword Checking Pin
ASGill5-Mar-04 17:21
ASGill5-Mar-04 17:21 
Hi...im trying to do password checking for multiple users...
the problem is that i get a runtime error saying the specified cast is invalid(line 272) ...i've check that im getting a string...so what could the problem be


<br />
private void btnOK_Click(object sender, System.EventArgs e)<br />
		{<br />
            dataSetPWD.Clear();		<br />
<br />
			if(txtPassword.Text.Length > 10 && txtPassword.Text != "")<br />
			{<br />
				MessageBox.Show("The password textbox should contain more than 1 character and less than 10 characters. Please check your password.","Information");<br />
				<br />
			}<br />
			else<br />
			{<br />
				try<br />
				{<br />
					oleDbConnection1.Open();<br />
<br />
					oleDbDataAdapter1.SelectCommand.CommandText = "SELECT UserType FROM Password WHERE UserName = '"+txtUsername.Text+"' AND Password = '"+txtPassword.Text+"'";<br />
                    	<br />
					<br />
					oleDbDataAdapter1.Fill(dataSetPWD);<br />
<br />
					System.Data.DataTable Password = dataSetPWD.Tables[0];<br />
<br />
					if(Password.Rows.Count != 0)<br />
					{				<br />
                        <br />
						string s = (string) Password.Rows[0][0];  --> LINE 272<br />
						s.Trim();<br />
						s.ToString();<br />
						<br />
<br />
						if(s.Equals("reception"))<br />
						{<br />
							frmReception rm = new frmReception();<br />
							rm.Show();<br />
						}<br />
						else if(s.Equals("doctor"))<br />
						{<br />
							frmDiagnosis dm = new frmDiagnosis();<br />
							dm.Show();<br />
						}<br />
						else if(s.Equals("pharmacy"))<br />
						{<br />
							frmPharMenu pm = new frmPharMenu();<br />
							pm.Show();<br />
						}<br />
							/*if(s.Equals("cashier"))<br />
							{<br />
								frmCashier cm = new frmCashier();<br />
								cm.Show();<br />
							}*/<br />
						else <br />
						{<br />
							MessageBox.Show("Invalid Password or User Name. Please check your user name and password. It is case sensitive","Invalid Entry");<br />
						<br />
						}<br />
					}<br />
					else<br />
					{<br />
						MessageBox.Show("No Such Record");<br />
					}<br />
				}<br />
				catch (Exception ErrorPassword)<br />
				{<br />
					MessageBox.Show(ErrorPassword.ToString(),"Password Error");<br />
				}<br />
				finally<br />
				{<br />
					oleDbConnection1.Close();<br />
					oleDbConnection1.Dispose();<br />
				}<br />
			}<br />
		<br />
		}<br />





CODER
GeneralRe: Password Checking Pin
mav.northwind5-Mar-04 20:02
mav.northwind5-Mar-04 20:02 
GeneralPramodKumarSingh mail sample Pin
jimaya5-Mar-04 10:13
jimaya5-Mar-04 10:13 
GeneralRe: PramodKumarSingh mail sample Pin
Heath Stewart5-Mar-04 12:06
protectorHeath Stewart5-Mar-04 12:06 
GeneralSystem.io.FileStream Pin
cmarmr5-Mar-04 8:35
cmarmr5-Mar-04 8:35 
GeneralRe: System.io.FileStream Pin
Henrik Stuart5-Mar-04 8:39
Henrik Stuart5-Mar-04 8:39 
GeneralRe: System.io.FileStream Pin
Werdna5-Mar-04 10:06
Werdna5-Mar-04 10:06 
GeneralRe: System.io.FileStream Pin
leppie6-Mar-04 1:11
leppie6-Mar-04 1:11 
GeneralRe: System.io.FileStream Pin
James T. Johnson6-Mar-04 12:59
James T. Johnson6-Mar-04 12:59 
GeneralRe: System.io.FileStream Pin
Tom Larsen5-Mar-04 11:30
Tom Larsen5-Mar-04 11:30 
GeneralRemoting error Pin
Kant5-Mar-04 8:15
Kant5-Mar-04 8:15 
GeneralRe: Remoting error Pin
Heath Stewart5-Mar-04 8:28
protectorHeath Stewart5-Mar-04 8:28 
GeneralRe: Remoting error Pin
Kant5-Mar-04 9:12
Kant5-Mar-04 9:12 
GeneralRe: Remoting error Pin
Heath Stewart5-Mar-04 9:27
protectorHeath Stewart5-Mar-04 9:27 
GeneralRe: Remoting error Pin
Kant5-Mar-04 9:51
Kant5-Mar-04 9:51 
GeneralRe: Remoting error Pin
Judah Gabriel Himango5-Mar-04 8:32
sponsorJudah Gabriel Himango5-Mar-04 8:32 
GeneralDrawing column headers Pin
Amberite005-Mar-04 8:10
Amberite005-Mar-04 8:10 
GeneralRe: Drawing column headers Pin
Heath Stewart5-Mar-04 8:27
protectorHeath Stewart5-Mar-04 8:27 

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.