Mitja Bonca 557 Nearly a Posting Maven

Then do:

Dim query As String = "UPDATE cg_security_user_right  SET user_id, right_id ,enable_flag  WHERE LastName = @param1 AND right_id = @param2 AND enable_flag = @param3"
Dim conn As New SqlConnection("connString")
Dim cmd As SqlComamnd = New SqlCommand(query, conn)
cmd.Parameters.Add("@param1", SqlDbType.VarChar, 50).Value = tuser.Text
cmd.Parameters.Add("@param2", SqlDbType.Int).Value = Integer.Parse(tright.Text)
'check if its not an integer, if its string, do as in line before
cmd.Parameters.Add("@param3", SqlDbType.Bit).Value = If(CheckBox1.Checked, 1, 0)
cmd.ExecuteNonQuery()
Mitja Bonca 557 Nearly a Posting Maven

hmm another question is there any way for the form (or the windows) to make it resolution independent?

It actually cannot be fully independent, it always has to addapt on the screen resolution (it has to based on it). You can have app. in 1290 x 1500 (or what ever), and if your screen is in 1680 X 1050, then you will have sliders inside your application to view all the content. And this is not something we want.
And one more thing: you cannot never know the resolution of user, right?
But something is deffenatelly sure, if your app. is on max 800x600, there is no worries - noone has lower resolution any longer :)

But to be sure, you always can do the check of the current resolution and addapt your application (and all the controls inside) based on the measurement of the screen.

Does this make any sence?
Hope it does :)
bye

Mitja Bonca 557 Nearly a Posting Maven

Thx, Im blushing :)

M.Waqas Aslam commented: sweet comment ahahhaahah :) u make me smile , +5
Mitja Bonca 557 Nearly a Posting Maven

Here is the solution (actually two of them):

'I have put 3 buttons on my form!!
Private buttons As Button()
Private pressedButton As Button
'OR:
Private _pressedButton As String
Public Sub New()
	InitializeComponent()

	'now lets create a common code for all:
	buttons = New Button() {button1, button2, button3}
	For i As Integer = 0 To buttons.Length - 1
		buttons(i).Name = "My button " & (i + 1)
		'specify name of the button
		buttons(i).Text = "Pres button " & (i + 1)
		'specify the text on the button
		buttons(i).Click += New EventHandler(AddressOf Buttons_Click)
	Next
End Sub

Private Sub Buttons_Click(sender As Object, e As EventArgs)
	Dim button As Button = TryCast(sender, Button)
	If button IsNot Nothing Then
		pressedButton = button
		_pressedButton = button.Name

		'show it here:
		RetreivePressedButton()
	End If
End Sub

Private Sub RetreivePressedButton()
	'you can call this method every time after click on button:
	MessageBox.Show("Pressed button was: " & Convert.ToString(pressedButton.Name) & ". And it still keeps this name in variable")
	'OR:
	MessageBox.Show("Pressed button was: " & _pressedButton & ". And it still keeps this name in variable")
End Sub
Mitja Bonca 557 Nearly a Posting Maven

You have to find our the screen resolution, and based on that, you then adjust your image (resize it).
How to get screen resolution and resize image:

Dim width As Integer = Screen.PrimaryScreen.WorkingArea.Width
Dim height As Integer = Screen.PrimaryScreen.WorkingArea.Height

Dim image__1 As Image = Image.FromFile("filePathToImage")
Dim newImage As New Bitmap(width, height)
Using gr As Graphics = Graphics.FromImage(newImage)
	gr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias
	gr.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
	gr.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality
	gr.DrawImage(image__1, New Rectangle(0, 0, width, height))
End Using
'now use newImage as background!
Mitja Bonca 557 Nearly a Posting Maven

try:

strsql = "delete from cg_security_user_right where user_id = '" & TextBox1.Text & "' role_id = '" & TextBox2.Text & "'"
Mitja Bonca 557 Nearly a Posting Maven

Remember:
1. you cannot do math operations over strings; you MUST convert them to appropriate type (I used integers, if trey are not, change them to appropriate type!!
2. messagebox shows strings, so if there is any value not-a-string, convert (or parse) it to stirng.
So do:

MessageBox.Show("Basic hours worked: " + txtHoursWorked.Text & vbCr & vbLf & 
"Hourly rate of pay: " & lstHourlyRate.SelectedItem.ToString() & vbCr & vbLf & 
"Basic pay: " & (Integer.Parse(txtHoursWorked.Text) * Integer.Parse(lstHourlyRate.SelectedItem.ToString())) & vbCr & vbLf & 
"Overtime hourly rate: " & DoubleRate & vbCr & vbLf & 
"Overtime pay: " & OvertimePay & vbCr & vbLf & 
"Total pay: " & (Integer.Parse(txtHoursWorked.Text) * Integer.Parse(lstHourlyRate.SelectedItem.ToString())))

If "vbCr & vbLf" dones not do, try using "Environment.NewLine"
Hope it helps,
bye

Mitja Bonca 557 Nearly a Posting Maven

Why not using some while(true) loop?
Then then you want to exit, just do "break;".

Mitja Bonca 557 Nearly a Posting Maven

You can use databiding from List<T> to listBox, and then check if items are in lists while looping through listBox:

Public Partial Class Form1
	Inherits Form
	Private list1 As List(Of String)
	Private list2 As List(Of String)
	Public Sub New()
		InitializeComponent()

		list1 = New List(Of String)() From { _
			"a", _
			"b", _
			"c", _
			"d" _
		}
		list2 = New List(Of String)() From { _
			"a", _
			"c", _
			"e", _
			"f" _
		}
		listBox1.DataSource = New BindingSource(list1, Nothing)
		listBox2.DataSource = New BindingSource(list2, Nothing)
	End Sub

	Private Sub button1_Click(sender As Object, e As EventArgs)
		For i As Integer = 0 To list1.Count - 1
			If list2.Contains(list1(i)) Then
				MessageBox.Show("Item " + list1(i) & " exists in both listBoxes.")
			End If
		Next
	End Sub
End Class
Reverend Jim commented: Cool. I did not know you could do that. +9
Mitja Bonca 557 Nearly a Posting Maven

Sure, you can use OldDBConnection class. Check here for details.

Mitja Bonca 557 Nearly a Posting Maven

HELP I NEED TO GENERATE A RANDOM ID FOR MY EXAM...

NEED TO GET THE FIRST 3 LETTERS OF THE FIRST NAME....How do I do this?been searching for hours..

Just as simple as waqasaslammmeo explained!! Use Substring() method.
1st number inside brackets is starting index (in your case is 0, becuase you want to start from beginning)
2n number is th lenght if the string (3 in your case).

This is it.

Mitja Bonca 557 Nearly a Posting Maven

kingsonprisonic:
STOP ANSWERING ONLY FOR GETTING POINTS ON THE SALVED THREAD. You didnt have nothing to do here - and in many other threads.
AND STOP doing a mess around. We dont need ppl like you here with this kind of attitude. Got it?

Mitja Bonca 557 Nearly a Posting Maven

Why use private fileds, if they are only visible from that class? Its pointless.

If you will use properties (like I did), they look like:

private string name;
public stirng Name
{
    get { return name; }
    set { name = value; }
}

in this say you can only acces to Name (public part of property), and not to name!
But I dont think you will use properties - and use them as private is pointless.
They can only be accessible from INSIDE this class.

So can I ask you who give you this task? Because its a bit strange (at least what you are trying to do).

ddanbe commented: Well explained +15
Mitja Bonca 557 Nearly a Posting Maven

This should be like this:

Textbox[] tbs;

//creating buttons:
private void button1_Click(object sender, EventArgs e)
{
    int total = 0;
    if(int.TryParse(textBox1.Text, out total)
    {
        tbs = new TextBox[total];
        int x = 20;  //x location
        int y = 20;  //y location
        for(int i = 0; i < tbs.Lenght; i++)
        {
            tbs[i] = new TextBox();
            tbs[i].Name = "textBox" + i.ToString();
            tbs[i].Location = new Location(x, y);
            tbs[i].Size = new Size(100, 23);
            this.Controls.Add(tbs[i]);
            //set new location for the next textbox:
            y += 30; //textboxes will be one under another           
        }
    }
    else
        MessageBox.Show("No number inserted!");

     //to iterate through textboxes:
     if(tbs.Lenght > 0)
     {
         string text = string.Empty;
         foreach(Textbox tb in tbs)
         {
             text = tb.Text; //this is actual text of particular textbox...
         }
     }
}

Hope it helps...
bye

Mitja Bonca 557 Nearly a Posting Maven

like:

Private Sub comboBox1_SelectedIndexChanged(sender As Object, e As EventArgs)
	Dim fileName As String = comboBox1.SelectedItem.ToString()
	textBox1.Text = [String].Format("{0}{1}{2}", "C:\files", fileName, ".txt")
End Sub
Mitja Bonca 557 Nearly a Posting Maven

You cannot set DataReader as a binding source to any control. Instead, you should use DataAdapter class.

//...
progress.Value = 40;
OleDbConnection conn = new OleDbConnection("connString");
DataTable table = new DataTable(); //can be a class variable too.
OleDbDataAdapter da = new OleDbDataAdapter("SELECT ID, Status FROM AH01", conn);
da.Fill(table);
GridView1.DataSource = table.DefaultView;
conn.Dispose();
progress.Value = 100;
Mitja Bonca 557 Nearly a Posting Maven

Simple way:

Private Sub button1_Click(sender As Object, e As EventArgs)
	Dim item As String = txtbuttons.text
	Dim tbs As TextBox() = {txtAns, txtAns2, txtAns3, txtAns4, txtAns5}
	For i As Integer = 0 To item.Length - 1
		tbs(i).Text = item(i).ToString()
	Next
End Sub
Pgmer commented: Good one. +6
Mitja Bonca 557 Nearly a Posting Maven

simpliest way to convert stirng to byte[] is:

string str = "some text";
byte[] byteArr = Encoding.UTF8.GetBytes(str);

in your case it seems that you dont have type of byte in the database, but its varchar, so you can only read it to string, like:

string str = (string)cmd.ExecuteScalar();
Mitja Bonca 557 Nearly a Posting Maven

I guess your problem in in inserting new custome into database.
Your sql query is not ok, chnage it to:

"INSERT INTO Registration (Customer_ID, First_Name, Last_Name, Date_of_Birth, Gender, Phone_Number, Email, Address) VALUES ('"& txtCustomerID.Text &"','" & txtFirstName.Text & "','" & txtLastName.Text & "','" & txtDateOfBirth.Text & "','" & txtGender.Text & "','" & txtPhoneNumber.Text & "', '" & txtEmail.Text & "', '" & txtAddress.Text & "')"

As you can see you have forgot to add double quotes when you define the parameters directly into query statement.

Mitja Bonca 557 Nearly a Posting Maven

Abstract method cannot have any code implementation.
Only overriden from it.

Mitja Bonca 557 Nearly a Posting Maven

Do it this way:

private void button1_Click(object sender, EventArgs e)
        {
            DateTime date = DateTime.MinValue;
            if (!DateTime.TryParse(textBox1.Text, out date))
            {
                string[] strSplit = textBox1.Text.Split('/');
                if (strSplit.Length == 1)
                    date = new DateTime(int.Parse(strSplit[0]), 1, 1);
                else if (strSplit.Length == 2)
                    date = new DateTime(int.Parse(strSplit[0]), int.Parse(strSplit[1]), 1);
            }
            MessageBox.Show("Real date time is " + date);
        }

Now you use "date" variable where ever you need to, or to set dateTimePicker control (to set date), or what ever.

Hope it helps,
bye

ddanbe commented: Great! +14
Mitja Bonca 557 Nearly a Posting Maven

You can adda rep +1 :)
I was trying really hard on the Sunday afternoon.

Mitja Bonca 557 Nearly a Posting Maven

Ok, I did an example code, how to upload files and show then in the list (listBox control). Then I added a richTextBox control on the form which is meant to show the file`s content (text usually).

NOTE: Dont forget to add a new namespace on top of the class when using FileInfo and StreamReader classes. This namespace its called System.IO;
So here it is:

//add a namespace on top here:
using  System.IO;
//among other namespases...


    public partial class Form1 : Form
    {
        List<FileInfo> listFiles;
        public Form1()
        {
            InitializeComponent();
          
        }


        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog open = new OpenFileDialog();
            open.Filter = "text files (*.txt)|*.txt|xml files (*.xml)|*.xml";
            open.Multiselect = true;
            open.InitialDirectory = @"C:\";
            if (open.ShowDialog() == DialogResult.OK)
            {
                listFiles = new List<FileInfo>();
                FileInfo fi;
                for (int i = 0; i < open.FileNames.Length; i++)
                {
                    fi = new FileInfo(open.FileNames[i]);
                    listFiles.Add(fi);
                    listBox1.Items.Add(Path.GetFileName(fi.FullName));
                }
            }
        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex > -1)
            {
                richTextBox1.Text = "";
                string fileName = listBox1.SelectedItems[0].ToString();
                foreach (FileInfo fi in listFiles)
                {
                    if (fileName == Path.GetFileName(fi.FullName))
                    {
                        using (StreamReader sr = new StreamReader(fi.FullName))
                        {
                            string text;
                            while ((text = sr.ReadLine()) != null)
                                richTextBox1.AppendText(text + "\n");
                        }
                    }
                }
            }
        }
    }

This code works, and so far it only opends *.txt files.

Mitja Bonca 557 Nearly a Posting Maven

A win form?

Mitja Bonca 557 Nearly a Posting Maven

This only depends of the structure of your code - where to catch exceptions. But ordinary we catch then on the place where they might occure.

Mitja Bonca 557 Nearly a Posting Maven

If you only want to add a Exception then do it like:

public int Sum(int a, int b)
        {
            if ((a < 0) || (b < 0))
            {
                throw new ArgumentException("Number cannot be negative");
            }
            else
            {
                return a + b;
            }
        }
Mitja Bonca 557 Nearly a Posting Maven

You can always use try-catch blocks to catch the exception. But in this cases of yours it seems not to need one.
If your method has a return type, you have to return this type in any place in the Sum method. Otherwise the compiler will throw an error.
You can do it:

private void YourMethod()
        {
            int a = -2;
            int b = 3;
            int c = Sum(a, b);
            if (c > 0)
            {
                //Ok!!
            }
            else
            {
                //show a message if needed
                //that some of values are negative
            }
        }

        public int Sum(int a, int b)
        {
            if (a < 0 || b < 0)
            {
                return 0;
            }
            else
            {
                return a + b;
            }
        }
Mitja Bonca 557 Nearly a Posting Maven

Sure you can do, but you cannot addd comboBox control to TextBox array. But you can add its text additionally, like:

Textbox[]tbs = { textBox1, textBox2, textBox3 }; // add all of them in here
StringBuilder sb = new StringBuilder();
foreach(TextBox tb in tbs)
     sb.AppendLine(tb.Text);
//adding text from comboBox too:
sb.AppendLine(comboBox1.SelectedItem.ToString());

System.IO.File.WriteAllText(@"C:\myFile.txt", sb.ToString());
Mitja Bonca 557 Nearly a Posting Maven

Sure you can - if its in any help to use 0.0 (maybe for some comparison), but better like this:

private void yourMethod()
{
    float = inputMethod(textBox1.Text);
    if(floaf == 0.0)
    {
         MessageBox.Show("Please enter a number in the account number section "); 
    }
}
public float inputMethod() 
{ 
    float temp; 
    if (!float.TryParse(txtInitialTemp.Text, out temp))    
       return 0.0F;
    else
       return temp;
}
Mitja Bonca 557 Nearly a Posting Maven

Use Crystal Reports. You can create fields, and pass parameters to them (inside parameters there are your data).
Check this website, and check all the links bellow.

Mitja Bonca 557 Nearly a Posting Maven

Try to use this code:

using System;
using Microsoft.Win32;

namespace MyApp
{
    class Program
    {
        static void Main(string[] args)
        {
            RegistryKey adobe = Registry.LocalMachine.OpenSubKey("Software").OpenSubKey("Adobe");
            if (adobe != null)
            {
                RegistryKey acroRead = adobe.OpenSubKey("Acrobat Reader");
                if (acroRead != null)
                {
                    string[] acroReadVersions = acroRead.GetSubKeyNames();
                    Console.WriteLine("The following version(s) of Acrobat Reader are installed: ");
                    foreach (string versionNumber in acroReadVersions)
                    {
                        Console.WriteLine(versionNumber);
                    }
                }
            }
        }
    }
}
Mitja Bonca 557 Nearly a Posting Maven

using keyword is instead of calling Dispose() method.
The same is:

SqlConnection sqlConn = new SqlConnection"(connString");
// rest of code..
// on the end you close  or dispose IDisposable object:
sqlConn.Dispose();

//its EXACTLY thw same as:
using (SqlConnection sqlConn = new SqlConnection("connString"))
{
    // rest of code..
}

Calling Close() or dispose() methods is not the same. When you close an object, you can actually then open it again, while you Dispose it, this object get equl to null. So you cannot open it again, unless you instanitate it again (using new keyword).

Hope it helps.

Mitja Bonca 557 Nearly a Posting Maven

:)
Simple isnt it?
Im glad you like it.

best regards,
bye

andur92 commented: You are awesome! +1
Mitja Bonca 557 Nearly a Posting Maven

What about this kind of loop:

int temp = 0;
            for (int i = 1; i <= 10; i++)
            {
                for (int j = 0; j < i; j++)
                {
                    Console.Write(++temp);
                }
                Console.WriteLine();
            }
            Console.ReadLine();
Mitja Bonca 557 Nearly a Posting Maven
datagridview1.Rows.Add(); //add new row to dgv control
int rowIndex = datagridview1.Rows.Count - 1; //get this row`s index

//now insert one row from dataTable:
//I will show you how to add 1st row from dataTable:
int rowIndex = dataGridView1.Rows.Count - 1;
for (int i = 0; i < table.Rows.Count; i++) //loop through thr rows of dataTable
{
    if (i == 0) //only add row at index 0 (1st row in dataTable)
    {
        for (int j = 0; j < table.Columns.Count; j++) //loop through thr columns of dataTable
        {
             dataGridView1[j, rowIndex].Value = table.Rows[i][j];
        }
        break; //when done, code will leave for loop (of rows) - makes code faster!
    }
}

Hope this helps.

Mitja Bonca 557 Nearly a Posting Maven

:)
you too.
I know how it feels like when you want to do something very badly, and you cannot succeed it. Thats why I wanna give others as much as I know.
bye

Mitja Bonca 557 Nearly a Posting Maven

Hm, you didnt say last time when I did this code for you, you will be using a new member insertion.
If so, you have to do it a bit differently, you have to check if a user from the dataTable exists in DGV, and if not, then you can insert a new member.

Like:

bool bUserExistance = false;
            //foreach datagridRow in datagrid
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                // if not a new row
                if (!row.IsNewRow) //checking for a new row
                {
                    if (!bUserExistance)
                    {
                        string memberDGV = dataGridView1[3, row.Index].Value.ToString();
                        // foreach dataRow in dataTable
                        foreach (DataRow dr in table.Rows)
                        {
                            string memberDT = dr[3].ToString();
                            if (memberDGV == memberDT)
                            {
                                bUserExistance = true;
                                break;
                            }
                        }
                    }
                    else
                        break;
                }
            }

            if (!bUserExistance)
            {
                // MessageBox.Show("member is not in here");
                insertMember();
                insertDate();
            }
            else
            {
                // MessageBox.Show("Member is in dgc");
                insertDate();
            }

SO this code now will go through all the rows of DGV and on each row will check all the rows of DataTable. If the use will be found, it will leave the both loops. If user will not be found will (for sure loop both the loops to the end), and when (in both cases) when leave the Rows of DGV loop, it will execute the code, regarding on the boolean flag.

Hope this will salve your problem.

Mitja Bonca 557 Nearly a Posting Maven

nice :)

foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        string memberDT = dr[0].ToString(); //0 is the index for the 1st column, so you have to adapt the code to suit the column indexes
                        if (memeberDGV == memberDT)
                        {
                            //member already exists in dgv!
                            count++;
                        }
                    }

the same goes for the columns in the dgv. Just set the indexes or columns names, so it will check the same ones.

Mitja Bonca 557 Nearly a Posting Maven

Remember, messages boxes, like you had them inside the code, will fire each row when looping through the dataTable. This is ok and normal (I reapeat, like you had them inside the loop).
I suggest you to use my code from the previos post, to notifly the user about duplications (if nothing else).

Mitja Bonca 557 Nearly a Posting Maven

Sure you are keep on getting messages. For every single check of the user, no matter if its in the "list" of dgv, or not.

Do you want to show the meesage only for the user which is already in the list, or you would like to show the message only ones - on the end, which will tell "There is/are usres in the list??

Mitja Bonca 557 Nearly a Posting Maven

Show me your whole code of this.

Mitja Bonca 557 Nearly a Posting Maven

Just make sure the able name of the DataTable objects (the variable name, like I used "table") are different. With other words, table names must be different one to each other. Then you can have 100 of them at ones.

Mitja Bonca 557 Nearly a Posting Maven

If its only this, then yoz can do:

// firstname, lastname, membership, accountid, date
            DataTable table = new DataTable(); // get the members (new ones)
            //now lets check if the member from table is already in the DGV:
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                string memeberDGV = dataGridView1[0, row.Index].Value.ToString();
                foreach (DataRow dr in table.Rows)
                {
                    string memberDT = dr[0].ToString();
                    if (memeberDGV == memberDT)
                    {
                        //member already exists in dgv!
                    }
                }
            }
Mitja Bonca 557 Nearly a Posting Maven

If you got the answer, please close the thread by marking as salved (answered).
thx in advance ;)

Mitja Bonca 557 Nearly a Posting Maven

You have to use UPDATE sql statement, not INSERT!!
like:
"UPDATE MyTableName SET @field2, @field3, @filed4 WHERE FieldName1 = @filed1"

Behind the SET keyword specify the field names (columns) you want to update. No need all, just those you want to update. And you must use a WHERE clause, so the code knows which row to update.
As simple as that.

Mitja Bonca 557 Nearly a Posting Maven

Hmm, then we have a problem here.
The code is meant to work in Win form.
About the generic list, it uses a "System.Collections.Generic" namespace (reference).

Put this code into a win form, and dont just copy/paste it, but you have to add event for controls, like (buttonSource_Click, ...), and then paste the code from here to your event.

ddanbe commented: Helpfull! +14
Mitja Bonca 557 Nearly a Posting Maven

Change sql query to:

insertDatetime = @"UPDATE WaynokaLogger SET Date = @Date WHERE AccountID = '" + newString + "'";

or use parametreized query:

insertDatetime = "UPDATE WaynokaLogger SET Date = @Date WHERE AccountID = @id";
da.UpdateCommand = new SqlCommand(insertDatetime, cs);
da.UpdateCommand.Parameters.AddWithValue("@Date", SqlDbType.DateTime).Value = DateTime.Now;
da.UpdateCommand.Parameters.AddWithValue("@id", SqlDbType.Int).Value = newString;
Mitja Bonca 557 Nearly a Posting Maven

Put Listener.Start() method, just under where you create a reference of TcpListener, so like:

private void initiateListen()
{
    //Tcp
    this.tcpListener = new TcpListener(IPAddress.Any, portnumber);
    tcpListener.Start(); //HERE!!
    //why you have this code bellow??
    //you need a new variable to get Port no:
    int intPort = Convert.ToInt32(portnotxt.Text.Trim());
    this.threadTcp = new Thread(new ThreadStart(ListenToClients));
}
Mitja Bonca 557 Nearly a Posting Maven

Thx for Voting :(

I will still help you out... what you have to do is to use WHERE clause to specify for which row you want to update the datetime. Do you have any Id, or some other unique column, so you can use the comparison?

Your query them will look:

da.UpdateCommand = new SqlCommand("UPDATE WaynokaLogger SET Date = @Date WHERE YourUniqueColumn = @uniqueColumn", cs);
da.UpdateCommand.Parameters.Add("@Date", SqlDbType.Date).Value = dt;
da.UpdateCommand.Parameters.Add("@uniqueColumn", SqlDbType.Int).Value = SomeUniqueValue;
da.UpdateCommand.ExecuteNonQuery();
SyncMaster170 commented: even when Mitja gets kicked while hes down, he still delivers. Very wise and helpful +1
Mitja Bonca 557 Nearly a Posting Maven

Try this:

Console.WriteLine("The tax rate will be: {0}.", TAX_RATE) ;
techlawsam commented: helped solve a syntax issue +1