Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
GeneralRe: Create a file and set the extended properties like companyname, comment, etc. Pin
jvbragt3-Feb-04 4:18
jvbragt3-Feb-04 4:18 
GeneralRe: Create a file and set the extended properties like companyname, comment, etc. Pin
Heath Stewart3-Feb-04 6:00
protectorHeath Stewart3-Feb-04 6:00 
Generalmessage boxes Pin
ASGill3-Feb-04 1:29
ASGill3-Feb-04 1:29 
GeneralRe: message boxes Pin
sps-itsec463-Feb-04 2:09
sps-itsec463-Feb-04 2:09 
GeneralRe: message boxes Pin
thomasa3-Feb-04 2:22
thomasa3-Feb-04 2:22 
GeneralRe: message boxes Pin
dxhdxh3-Feb-04 3:10
dxhdxh3-Feb-04 3:10 
GeneralRe: message boxes Pin
Heath Stewart3-Feb-04 6:17
protectorHeath Stewart3-Feb-04 6:17 
GeneralRe: message boxes Pin
ASGill3-Feb-04 16:58
ASGill3-Feb-04 16:58 
Thanx for the solutions but.....i tried all three solutions....i dunno why, but i still get the same errors...tried searchin around but to no avail...couldnt find one solution at all...well this is my last resort...i hope someone can point out whats wrong whit this code ..:

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;



namespace CLINICINFORMATIONSYSTEM
{

/// Summary description for Password.
public class frmPassword : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox txtUserName;
private System.Windows.Forms.TextBox txtPassword;
private System.Windows.Forms.Label lblUserName;
private System.Windows.Forms.Label lblPassword;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Data.SqlClient.SqlConnection sqlConnection1;

private System.ComponentModel.Container components = null;

public frmPassword()
{

InitializeComponent();
SqlConnection myConnection = new SqlConnection("user
id=username;" +
"password=password;server=serverurl;" +
"Trusted_Connection=yes;" +
"database=database; " +
"connection timeout=30");
try
{
myConnection.Open();
}
catch(Exception e) <problem area, error 1>
{
MessageBox.Show("Unable to connect to server. Please try again" , "Reminder" , MessageBoxButtons.RetryCancel , MessageBoxIcon.Warning); <problem area, error 4 and 5>
}


}

private void btnOK_Click(object sender, System.EventArgs e)
{
if(txtPassword.Text > 10) <problem area, error 3>
{
MessageBox.Show("The password should not be more than TEN characters. Please check your password again", "Reminder" ,MessageBoxButtons.OK,MessageBoxIcon.Warning); <---the problem area again! <problem area, error 2>
}
else.............


..............................................................................
with this i get these errors :

1 . the value 'e' is declared but never used

2 . The best overloaded method match or'System.Windows.Forms.MessageBox.Show string, string, System.Windows.Forms.MessageBoxButtons)' has some invalid arguments

3. Operator '>' cannot be applied to operands of type 'string' and 'int'

4. Argument '3': cannot convert from 'System.Windows.Forms.MessageBoxIcon' to 'System.Windows.Forms.MessageBoxButtons'

5. Argument '2': cannot convert from 'System.Windows.Forms.MessageBoxButtons' to 'string'

well im really hoping someone could point out to me whats realy wrong with this code...im nearing my deadline but this problem has delayed me by a DAY!!


Thanx a million







Arvinder Gill
GeneralRe: message boxes Pin
Heath Stewart3-Feb-04 18:04
protectorHeath Stewart3-Feb-04 18:04 
GeneralPrintPreviewDialog Pin
Anonymous3-Feb-04 1:16
Anonymous3-Feb-04 1:16 
GeneralRe: PrintPreviewDialog Pin
Heath Stewart3-Feb-04 4:18
protectorHeath Stewart3-Feb-04 4:18 
GeneralRe: PrintPreviewDialog Pin
Anonymous4-Feb-04 1:05
Anonymous4-Feb-04 1:05 
GeneralRe: PrintPreviewDialog Pin
Heath Stewart4-Feb-04 3:42
protectorHeath Stewart4-Feb-04 3:42 
GeneralRe: PrintPreviewDialog Pin
Anonymous4-Feb-04 4:07
Anonymous4-Feb-04 4:07 
GeneralSerialization of object references Pin
sps-itsec463-Feb-04 0:43
sps-itsec463-Feb-04 0:43 
GeneralRe: Serialization of object references Pin
Heath Stewart3-Feb-04 4:25
protectorHeath Stewart3-Feb-04 4:25 
GeneralRe: Serialization of object references Pin
sps-itsec463-Feb-04 6:18
sps-itsec463-Feb-04 6:18 
GeneralRe: Serialization of object references Pin
Heath Stewart3-Feb-04 6:38
protectorHeath Stewart3-Feb-04 6:38 
GeneralDecimal Places Pin
Reinier van de Wetering2-Feb-04 19:41
Reinier van de Wetering2-Feb-04 19:41 
GeneralRe: Decimal Places Pin
Rampas Tomas2-Feb-04 22:32
Rampas Tomas2-Feb-04 22:32 
GeneralRe: Decimal Places Pin
Heath Stewart3-Feb-04 4:36
protectorHeath Stewart3-Feb-04 4:36 
GeneralDatagrid row Color Pin
Reinier van de Wetering2-Feb-04 19:19
Reinier van de Wetering2-Feb-04 19:19 
GeneralRe: Datagrid row Color Pin
Mazdak2-Feb-04 22:09
Mazdak2-Feb-04 22:09 
GeneralRe: Datagrid row Color Pin
Reinier van de Wetering3-Feb-04 19:19
Reinier van de Wetering3-Feb-04 19:19 
GeneralRe: Datagrid row Color Pin
Reinier van de Wetering3-Feb-04 19:49
Reinier van de Wetering3-Feb-04 19:49 

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.