Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

There's nothing wrong with having multiple adapters so long as they're differently named and you duplicate the remainder of the components below the adapter in the data retrieval process with different names than the first set (ie: command, dataset, etc).

Alternately...

If the 2 queries are similar but with one or two differences (ie: same subset of data but with different conditions on the WHERE portion) you can just have a dynamically populated SELECT string and run the ONE set of everything twice with 2 different values... the only thing you'd have to do then is ensure that the population portion (where the data gets put in your form) is separated and the SELECT string is swapped between the reads.

For Example (just gonna use pseudocode for this):

string sqlSelectString = "SELECT * FROM dbName WHERE conditionA";
private void dbConnecting()
{
--insert usual connection setup here--
sqlDataAdapter myAdapt = new sqlDataAdapter(sqlSelectString, connection);
--insert command and dataset population here--
}
private void getFirstPop()
{
    dbConnecting();
    --insert population of form fields from dataset--
}
private void getSecondPop()
{
    sqlSelectString = "SELECT * FROM dbName WHERE conditionB";
    dbConnecting();
    --insert population of form fields from dataset--
}

Again this is piecemeal pseudocode just to give the logic cus it's now almost 4:15am here :P

Hope it helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I'm not sure if it's what you want to do per-se but have you tried (when they choose to cancel) using Application.Exit() instead of just closing the forms? I assume if they cancel login you don't want the application running any longer.

Edit: What Farooqaa said :P (I stepped away for a bit and forgot to reload the thread to see if other answers were here before I replied)
Edit 2: And now, as it's 4am here... :zzz: Don't forget to mark the thread as solved once you're done resolving your issue.

farooqaaa commented: :) +2
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

You can disable the X close button on the login form. ControlBox = false.

I believe you can also code to ensure they can't do a right-click close as well but I'm not sure how to do that or if it's even necessary once you've disabled the ControlBox.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Glad to help :) Please don't forget to mark the thread as solved if this issue has been resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

You're looking to make your login form a modal form...

A Modal Form basically means that you cannot proceed with the program until the modal form's task has been performed and the form is removed by the program.

For more information on how to implement modal forms check this link.

Hope this helps :) Please remember to mark this thread solved when your issue is resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Is this meant to be an ASP.Net web-form application or a C# windows-form application?

If it's a web-form application then:
1)It should have been posted in the ASP.Net forum
2) I'm not really sure how to get the value of the address bar if it's an URL outside of your site (such as google) but you can get the query string of the URL leading to your ASP.Net page (ie: www.yoursite.com?query=value by using

string myQuery = ClientQueryString;

If you're using a webBrowser control in a windows-forms application you can use the following to get the current URL from the webBrowser component but it'd be somewhat pointless since using a webBrowser component, the navigation would be based off another text input component of your windows form and you could simply get the info from there:

webBrowser1.Url.ToString();

Don't know if either of those help, the question wasn't exceedingly clear to me sorry :( Please remember to mark the thread as solved if it does get resolved though.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Basically (if I remember my C# theory right) that's basically just the deconstructor for classes within your project.

Essentially when you drop something (close a form, exit the application, anything that ends the use of objects within the project) it calls for a disposal of that object.

The code snippet you've supplied basically says that when you call Dispose on an object it checks to see if there are any components active within the object. If there are it disposes of them first and then disposes of the object itself.

Basically just trash management :)

I could be completely wrong tho, been a couple years since I bothered reading the code theory part of my texts and that particular snippet is usually buried in the code-behind-the-code-behind :P

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I'm going to go out on a limb here and assume that the reason you've posted this is because you're looking for a solution for the error at the top...

It's pretty explicitly telling you the problem is with the following line:
>>Line 12: <connectionStrings/>

That being said, as there are no connection strings defined in your web.config file, you could easily delete that line entirely with no effect on your project (other than eliminating the error).

Generally, any section of a web.config file that serves no purpose doesn't even need to exist in the file. In your case that would include:
>> <appSettings/>
>> <connectionStrings/>

Hope this helps :) Please remember to mark this thread solved once the issue is resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Let me start off by saying that I don't believe a "blanket ban" is a solution in any discussion of firearms. It has generally been shown that any attempt to completely ban something has the converse effect of causing increased interest in having/doing that thing.

Here in Canada we already have some rather strict firearms laws with regards to the ownership and transport of handguns and automatic weapons. The laws are a bit more lax with regards to hunting rifles and the like but you're still not allowed to just walk down the street with a shotgun on your arm or anything.

The laws preventing standard citizens from walking around with, for example, a handgun on their person, have done little however to prevent guns from becoming available to those who really want one and have done even less to prevent gun related violence.

I will say though that I am exceptionally glad not to be living in Texas where, it seems, they are required to post signs at the airport specifically preventing residents from carrying their guns into the airport as citizens are legally allowed to walk around with handguns strapped to their hips.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Haha! Been there done that (with my own site) but... no harm no foul! :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Don't forget to mark the thread solved if your problem is resolved by any of the above suggestions or on your own. That way people don't think the issue is ongoing :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I really like Lusiphur's suggestion of the repeating background, keeps the site from looking too choppy.

Also, looked at your image - you have the header and footer in one image file. Doing this will always have the bottom wave underneath the text since it would be part of the body background file.

I recoded a bit (practicing my coding - have to do some for work and this site has been very helpful with giving me excellent practice and ideas).

I have uploaded the idea (very very rough - but an idea) here and posted the code below.

CSS

#bodyBG {
    margin-top: 0;
	background-color:#FFFFFF;
	background-image:url(TopWave2.gif);
	background-position:top;
	background-repeat:repeat-x;
    }
	
#header {
	font-family:Arial, Helvetica, sans-serif;
	color:#FFFFFF;
	font-size:16px;
	font-weight:bold;
	width:100%;
	height:200px;
	text-align:center;
	vertical-align:middle;
	padding-top:15px;
	}
	
	
	
#content {
    width:800px;
    margin:auto;
	font-family:Arial, Helvetica, sans-serif;
	font-size:12px;
	color:#333333;
	position:relative;
	top:0px;
	background-color:#95CAFF;
	height:500px;
	padding:10px;
    }

#footer {
	width:110%;
	height:100%
	position:absolute;
	bottom:-20px;
	left:-20px;
	background-position:bottom;
	}

#wave {
	background-image:url(BottomWave.gif);
	background-position:bottom;
	background-repeat:repeat-x;
	position:relative;
	bottom:-20px;
	left:-20px;
	height:90px;
	}

Html Code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SIA "Kāpieni 96"</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body id="bodyBG">

<div id="header">The page header would be here</div>

<div id="content">This section would have the main content for the site</div>

<div id="footer"><div id="wave"></div></div>
</body>
</html>

This is some excellent work there macgurl, and darnit this site just won't let me give you more rep til I give more to other people (as soon as I find posts worth giving it to …

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I have to admit I'm drawing blanks on how to clear the items within a dataGrid. That construct was replaced by dataGridView many years ago and documentation (useful documentation) on manipulation of dataGrid items is hard to find.

Honestly, if you're using VS 2003 it might be time for an upgrade since we're now dealing with a 7 year gap in technology there.

Sorry I couldn't be more help :(

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Oh ho.... dataGrid, not dataGridView...

That's why the suggestions given above don't work (Rows.Clear()) because it's a dataGrid and not a dataGridView so they have different properties.

You might have some success with .Items.Clear()... might not, doing some research on it for you at the moment.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

So there's no dgresults.Items.Clear()?

Hmm... I was hoping not to have to open my VS for this one LoL give me a few min.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I believe what he's getting at is for you to put your own datagridview's name where his sample has dataGridView1.

As such:

if (this.dgresults.DataSource != null)
{
     this.dgresults.DataSource = null;
}
else
{
    this.dgresults.Rows.Clear();
}
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I've got one word for you ...

Ready? ...

Here it comes ...

Google <-- iz a link to a pre-made search :cool:

Hope this helps :) Please mark solved if your issue is resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

No worries :) Just pointing it out for future reference.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Just a quick note... nothing against your requests but...

1) please phrase your post titles to give some idea of the question contained
2) please please PLEASE stop adding a line of periods at the end of every single post title you create :)

Having two identically titled posts about different problems you're having (even if they're related to the same project) is confusing to say the least and makes it look like a duplicate post at first glance through the post titles.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Hmm... if you want the repeating waves at the bottom of the page always, you could try adding "background-position:bottom;" to the #BG id in your CSS file. This should push the background (tiling horizontally) to the bottom of the DIV, in which case your #BodyBG background-color should likely be #000 (black) to match the top of the wave tiles.

Edit: just a design note, you may want to trim a bit off the left or right of your wave tile to match the lines up a bit :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I was tossing the only thing I could find in there since I, also, don't know of anything in .Net that does "exactly" what they're looking for. You can't expect all of my posts to be gold can you? :P

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Also, to keep DaniWeb a student-friendly place to learn, don't expect quick solutions to your homework. We'll help you get started and exchange algorithm ideas, but only if you show that you're willing to put in effort as well.

Do you have any code examples of your attempts to do this task? Perhaps we can help you figure out where you're stuck at a certain point :)

Also, try this reference in relation to the System.Drawing namespace and it's usage.

As well as this reference which presents a tutorial in the use of the System.Drawing namespace.

And pretty much 90% of the things that come up when you use Google to do a bit of research :)

Hope this helps :) Please mark as solved if this resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

You can also use ToString()

yes, you can, it's a matter of preference :)

You can certainly use int32VariableName.ToString() if it's not already in string form.

My point, however, was that it SHOULD be in string form already if it's contained in a textBox :twisted:

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

>> Warning 1 Field 'Project_12_1_Create_Basic_Calculator.frmCalculator.secondNumber' is never assigned to, and will always have its default value 0 as I said above, when you hit the equals button you need to assign the current visible number to secondNumber first :)

>>Warning 2 The field 'Project_12_1_Create_Basic_Calculator.frmCalculator.answerNumber' is never used
Wherever you have answerNumber declared in your frmCalculator form just place a // before it to comment it out as this version of the code doesn't use it.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

In your code you had your methods for declaring your variables, in mine I didn't so that's why I drew the results directly from separate textboxes (just to test them).

In your case you don't need to additionally declare

double firstNum = Convert.ToDouble(firstNumber.Text);
double secondNum = Convert.ToDouble(secondNumber.Text);
string arithProc = arithmeticProcess.Text;

Within your button click as you already have them declared as part of the other processes (at least firstNumber and arithmeticProcess) however you do need to put the 2nd number value into the variable when the equals button is pressed in order to pass the value to the Calculator class.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

To illustrate the 2nd possibility where the actual methods and such are actually utilized (which I assume may be part of your assignment) I used the same form with 4 text boxes and 1 button but changed the Calculator class to this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace testApp
{
    public class Calculator
    {
        private string arithmeticProcess;
        private double firstNumber;
        private double secondNumber;
        private double answerNumber;

        public Calculator()
        {
        }

        public void setVars(double firstNum, double secondNum, string arithProc)
        {
            ArithmeticProcess = arithProc;
            FirstNumber = firstNum;
            SecondNumber = secondNum;
        }

        public string ArithmeticProcess
        {
            get
            {
                return arithmeticProcess;
            }
            set
            {
                arithmeticProcess = value;
            }
        }

        public double FirstNumber
        {
            get
            {
                return firstNumber;
            }
            set
            {
                firstNumber = value;
            }
        }

        public double SecondNumber
        {
            get
            {
                return secondNumber;
            }
            set
            {
                secondNumber = value;
            }
        }

        public double AnswerNumber
        {
            get
            {
                return answerNumber;
            }
            set
            {
                answerNumber = value;
            }
        }

        public void Equals()
        {

            if (ArithmeticProcess == "+")
            {
                AnswerNumber = FirstNumber + SecondNumber;

            }
            else if (ArithmeticProcess == "-")
            {
                AnswerNumber = FirstNumber - SecondNumber;

            }
            else if (ArithmeticProcess == "*")
            {
                AnswerNumber = FirstNumber * SecondNumber;

            }
            else if (arithmeticProcess == "/")
            {
                AnswerNumber = FirstNumber / SecondNumber;

            }
        }

        public string GetDisplayText()
        {
            return AnswerNumber.ToString();
        }
    }
}

And then I changed the form1.cs to this:

Calculator newCalc = new Calculator(); //Create instance of Calculator called newCalc

        private void btnEquals_Click(object sender, EventArgs e)
        {
            double firstNum = …
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok... I debug'd using the following (because you need this info to see what I did):

  1. I created a blank form and populated it with 4x textBox
  2. textBox1 was renamed firstNumber
  3. textBox2 was renamed arithmeticProcess
  4. textBox3 was renamed secondNumber
  5. textBox4 was renamed txtDisplay
  6. I added 1 button and named it btnEquals

At this point I created the Calculator class (the only difference here from what you will need is the namespace)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace testApp
{
    public class Calculator
    {
        public string arithmeticProcess;
        public double firstNumber;
        public double secondNumber;
        public double answerNumber;

        public Calculator()
        {
        }

        public Calculator(string arithmeticProcess, double firstNumber, double secondNumber, double answerNumber)
        {
            this.FirstNumber = firstNumber;
            this.ArithmeticProcess = arithmeticProcess;
            this.SecondNumber = secondNumber;
            this.answerNumber = answerNumber;

        }

        public string ArithmeticProcess
        {
            get
            {
                return arithmeticProcess;
            }
            set
            {
                arithmeticProcess = value;
            }
        }

        public double FirstNumber
        {
            get
            {
                return firstNumber;
            }
            set
            {
                firstNumber = value;
            }
        }

        public double SecondNumber
        {
            get
            {
                return secondNumber;
            }
            set
            {
                secondNumber = value;
            }
        }

        public double AnswerNumber
        {
            get
            {
                return answerNumber;
            }
            set
            {
                answerNumber = value;
            }
        }

        public double Equals(double firstNumber, double secondNumber, string arithmeticProcess)
        {

            if (arithmeticProcess == "+")
            {
                answerNumber = firstNumber + secondNumber;

            }
            else if (arithmeticProcess == "-")
            {
                answerNumber = firstNumber - secondNumber;

            }
            else if (arithmeticProcess == "*")
            {
                answerNumber = firstNumber * secondNumber;

            }
            else if (arithmeticProcess == "/")
            {
                answerNumber = firstNumber / secondNumber;

            }
            return …
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

one sec... I want to try it in my VS and see where I buggered it before posting again lol

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Sry, ok... try copy/pasting the code I gave you in this post directly.

It's all your original code with my modifications so you should be able to copy from top to bottom of the Calculator class code to completely overwrite your existing Calculator class code. Use the Toggle Plain Text option to give direct access to the code without the numbers being copied too.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

still getting the same error messages...
here is the modified code

Main Form

private void btnEquals_Click(System.Object sender, System.EventArgs e)
        {
            Calculator newCalc = new Calculator();
            txtDisplay.Text = Convert.ToString(newCalc.Equals(firstNumber, secondNumber, arithmeticProcess));
         
        }

Calculator Class

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Project_12_1_Create_Basic_Calculator
{
    public class Calculator
    {
        public string arithmeticProcess;
        public double firstNumber;
        public double secondNumber;
        public double answerNumber;
        
        public Calculator()
        {
        }

        public Calculator(string arithmeticProcess, double firstNumber, double secondNumber, double answerNumber)
        {
            this.FirstNumber = firstNumber;
            this.ArithmeticProcess = arithmeticProcess;            
            this.SecondNumber = secondNumber;
            this.answerNumber = answerNumber;
            
        }

        public string ArithmeticProcess
        {
            get
            {
                return arithmeticProcess;
            }
            set
            {
                arithmeticProcess = value;
            }
        }

        public double FirstNumber
        {
            get
            {
                return firstNumber;
            }
            set
           {
               firstNumber = value;
            }
        }

        public double SecondNumber
        {
            get
            {
                return secondNumber;
            }
            set
            {
                secondNumber = value;
            }
        }

        public double AnswerNumber
        {
            get
            {
                return answerNumber;
            }
            set
            {
                answerNumber = value;
            }
        }

        public static double Equals(double firstNumber, double secondNumber, string arithmeticProcess)
        {
            double answerNumber;
            if (arithmeticProcess == "+")
            {
                answerNumber = firstNumber + secondNumber;
                
            }
             else if (arithmeticProcess == "-")
            {
                answerNumber = firstNumber - secondNumber;
                
            }
            else if (arithmeticProcess == "*")
            {
               answerNumber = firstNumber * secondNumber;
                
            }
            else if (arithmeticProcess == "/")
            {
                answerNumber = firstNumber / secondNumber;
                
            }
            return answerNumber;
        }

           
    }
}

You've double-declared answerNumber, try just copy/pasting my prior example :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

As a side note, you did an excellent job declaring methods for getting and setting the values of your class variables.

However, this is really only necessary when:

  1. Your variables are "private" or otherwise not visible outside the class
  2. You have procedures to set/retrieve the variables

An example of using the methods you set would be:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Project_12_1_Create_Basic_Calculator
{
    public class Calculator
    {
        private string arithmeticProcess;
        private double firstNumber;
        private double secondNumber;
        private double answerNumber;
        
        public Calculator()
        {
        }

        public void setVars(double firstNum, double secondNum, string arithProc)
        {
            ArithmeticProcess = arithProc;
            FirstNumber = firstNum;
            SecondNumber = secondNum;
        }

        public string ArithmeticProcess
        {
            get
            {
                return arithmeticProcess;
            }
            set
            {
                arithmeticProcess = value;
            }
        }

        public double FirstNumber
        {
            get
            {
                return firstNumber;
            }
            set
           {
               firstNumber = value;
            }
        }

        public double SecondNumber
        {
            get
            {
                return secondNumber;
            }
            set
            {
                secondNumber = value;
            }
        }

        public double AnswerNumber
        {
            get
            {
                return answerNumber;
            }
            set
            {
                answerNumber = value;
            }
        }

        public static void Equals()
        {
            
            if (ArithmeticProcess == "+")
            {
                AnswerNumber = FirstNumber + SecondNumber;
                
            }
             else if (ArithmeticProcess == "-")
            {
                AnswerNumber = FirstNumber - SecondNumber;
                
            }
            else if (ArithmeticProcess == "*")
            {
               AnswerNumber = FirstNumber * SecondNumber;
                
            }
            else if (arithmeticProcess == "/")
            {
                AnswerNumber = FirstNumber / SecondNumber;
                
            }
        }

        public static string GetDisplayText()
        {
            return AnswerNumber.ToString();
        }
    }
}

make note of the CAPITAL letters vs the lower case letters. And …

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Use of unassigned local variable 'answerNumber'

Which also reminds me... answerNumber needs to be defined as a double in your Program class as well, I assumed it was declared in the excluded portion of the Program class prior to the button click event. Tho in the example I provided a moment ago, this is not required as I take the result of the Equals procedure and apply it directly to the text box.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok... I was probably somewhat confusing in how I worded it the last time so here it is step by step :)

First, your program class:

Calculator newCalc = new Calculator(); //Create instance of Calculator called newCalc

private void btnEquals_Click(System.Object sender, System.EventArgs e)
    {            
        txtDisplay.Text = Convert.ToString(newCalc.Equals(firstNumber, secondNumber, arithmeticProcess));         
    }

Then the Calculator class:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Project_12_1_Create_Basic_Calculator
{
    public class Calculator
    {
        public string arithmeticProcess;
        public double firstNumber;
        public double secondNumber;
        public double answerNumber;
        
        public Calculator()
        {
        }

        public Calculator(string arithmeticProcess, double firstNumber, double secondNumber, double answerNumber)
        {
            this.FirstNumber = firstNumber;
            this.ArithmeticProcess = arithmeticProcess;            
            this.SecondNumber = secondNumber;
            this.answerNumber = answerNumber;
            
        }

        public string ArithmeticProcess
        {
            get
            {
                return arithmeticProcess;
            }
            set
            {
                arithmeticProcess = value;
            }
        }

        public double FirstNumber
        {
            get
            {
                return firstNumber;
            }
            set
           {
               firstNumber = value;
            }
        }

        public double SecondNumber
        {
            get
            {
                return secondNumber;
            }
            set
            {
                secondNumber = value;
            }
        }

        public double AnswerNumber
        {
            get
            {
                return answerNumber;
            }
            set
            {
                answerNumber = value;
            }
        }

        public static double Equals(double firstNumber, double secondNumber, string arithmeticProcess)
        {
            
            if (arithmeticProcess == "+")
            {
                answerNumber = firstNumber + secondNumber;
                
            }
             else if (arithmeticProcess == "-")
            {
                answerNumber = firstNumber - secondNumber;
                
            }
            else if (arithmeticProcess == "*")
            {
               answerNumber = firstNumber * secondNumber;
                
            }
            else if (arithmeticProcess == "/")
            {
                answerNumber = firstNumber / secondNumber;
                
            }
            return answerNumber;
        }

            /*public static string GetDisplayText(double answerNumber)
            {
                return answerNumber.ToString();
            }*/
    }
}

MOST of the stuff …

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I've got a bit of a concern in the way the information is being passed to the calculator class and in the way the answer textbox is being populated.

First:

answerNumber = Calculator.Equals(firstNumber, secondNumber, arithmeticProcess, answerNumber);

It appears as if you're passing answerNumber to the calculator to get back a value of answerNumber. Realistically the values to be passed to the calculator should be just firstNumber, secondNumber, arithmeticProcess (and the calculator class should be adjusted to accept those 3 inputs).

Second:

txtDisplay.Text = Calculator.GetDisplayText(answerNumber);

Again it looks as though you are passing the answer back to the calculator... for it to pass you back the answer. If anything, once the calculator has passed you back the answer (via Return answerNumber in the calculator class) you should be simply transferring this value to the textBox and not passing it right back to the calculator for it to pass back as a string.

Alternate method: Instead of using a return value on the Equals process, simply store the information in the variable answerNumber within the calculator class. Then, use the GetDisplayText() process to call the locally stored answerNumber variable within it's own class and return it to you in text form for the textBox.

So... basically... I would do it one of two ways:

private void btnEquals_Click(System.Object sender, System.EventArgs e)
{
    Calculator.Equals(firstNumber, secondNumber, arithmeticProcess);
    txtDisplay.Text = Calculator.GetDisplayText();
}

Where the Equals procedure in the calculator class takes 3 variables and stores the answer within the …

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

HA!!! I can't believe I didn't see this before...

You've got it working just fine... the only thing you're doing wrong is your div statements.

Change <div class="leftbox"> and <div class="rightbox"> to <div id="leftbox"> and <div id="rightbox"> and you should be golden. Oh, and ya, change the rightbox definition's float to right instead of left.

I did some testing of my own and with the following CSS:

#wrap {
	width: 1024px;
	margin: 0 auto;
}
#leftbox {
	width: 678px;
	float: left;
}
#rightbox {
	width: 346px;
	float: right;
}

and the following HTML

<body>
<div id="wrap">
    <div id="leftbox">
        Featured Content
    </div>
    <div id="rightbox">
        Recent Threads
    </div>
</div>
</body>

I get a 2-column effect as intended but if I used "<div class=" instead they appeared one on top of each other.

Hope this helps :) Please mark solved if your problem is resolved.

samw1 commented: Thank you!! It worked. Some many hours wasted for such all small thing. +0
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Something I didn't think of before...

Divs default to having some padding to their "container" which could be causing an issue since your two (left and right) divs add up to a total combined width of 1024 and are being placed inside a div of width 1024.

You may want to make sure you a) set all padding to 0 and b) possibly shrink the component divs by a few pixels so they don't overload the containing wrapper div.

Also, ya, my brain doesn't work today cus I actually DELETED your #'s when I was copying your example and they were there in the first place :P

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I'm way too warm and my brain's not workin' right today but...

You have:

wrap {width:1024px;overflow:hidden;margin: 0 auto;background-image:url(sources/wrapbg.jpg);}
leftbox {width:678px;overflow:hidden;float:left;}
rightbox {width:346px;overflow:hidden;float:left;}

And I'm kinda thinking that rightbox should be:

rightbox {width:346px;overflow:hidden;float:right;}

But again, I've been having an off day today so I could be 100% wrong on this :P

Hope this helps :) Please mark as solved if it resolves your issue.

Edit: I'm also wondering why those "classes" don't have a # or . notation to them but *shrug* not gonna concern myself with the little things hehe

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ya, sorry Ardav lol I've just been too darned warm here to think straight, I tried to compensate for it in my edit but... basically my point was you can use css classes in multiple varieties to alter the buttons :P

I think what I semi-realized after I posted (hense the edit) was that they may have been trying to create the buttons at the css level. Oh well, chalk it up to "Not one of Lu's better days" :P

Edit: Not that it matters as the OP hasn't gotten back to his own thread anyway lol

Edit 2: I think what happened there was I copy/pasted their original, and had been working a lot in background/div style CSS responses earlier, and just kinda ran with it... or something.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

This might help. Not entirely sure if it'll do what you need it to but it seems like it might.

Hope this helps :) Please mark solved if it resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

either way, if you have a variable that is int32 and you want it as a string you can use:

string newString = Convert.ToString(int32Variable);

But as I said, any content of a textBox is already a string, therefor is a text value not an integer... so you should just be able to call textBoxName.Text to get your string value as it seems your .dll has already pre-converted the int32 value to a string in order to populate it into the textbox in the first place.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Have you tried using excelApp.Sheets[0] for the first sheet, excelApp.Sheets[1] for the second sheet and so on?

This page at msdn.microsoft.com is a good reference point for finding the various properties that are available within the Excel.Application class.

Hope this helps :) Please mark as solved if it resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I'm confused...

>> int32 is inside the text box
and
>> I would like to convert the int32 to text.

are somewhat mutually exclusive.

If it's already within a textBox then it is already text... simply use

string myInt32AsText = textBoxName.Text;

Obviously somewhere else in your code the Int32 has already been converted to text (explicitly or implicitly) prior to being inserted into the textBox.

Hope this helps :) Please mark as solved if this resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

First, (silly question but I have to ask) is the .css file saved?

Second, try adding

<style type="text/css">
<!--
@import url("site_layout.css");
-->
</style>

For some reason I find @import works better than "<link href="/site_layout.css" rel="stylesheet" type="text/css">" for me.

Hope this helps :) Please mark as solved if this resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

For more information on reputation check this (ancient) thread where it was discussed in great detail :)

When you get a reputation boost that shows "Even" and has a grey box it means the person who gave the rep was not capable of raising or lowering your rep score (usually very new members).

Only green (positive) and red (negative) boxes next to the reputation attempt reflect in a change to your reputation level. The amount they reflect is determined by that particular user's ability to change reputation which is in turn (at least partially) determined by THEIR reputation.

Hope this helps :) Please mark as resolved if it resolves your issue.

Edit: After looking at both threads you linked and checking the reputation giver's profile they are both showing as "Newbie Poster" and more importantly showing:
Power to Affect Someone Else's Reputation Positively: 0 points
Power to Affect Someone Else's Reputation Negatively: 0 points
Edit 2: Had to add this lol... Also a person can only give reputation up to 10 times in a day if I read it properly which is likely why the rep boost I just received didn't actually affect me.

jonsca commented: You've gotten to know the site quickly! +0
TrustyTony commented: I should be able to boost your rep by one! +0
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

The beauty of CSS is that a style/class can be applied repeatedly to different items. The additional beauty is you can define as many styles/classes as you want to.

That being said:

#button_a {
    display: block;
    background: url(rolloverimage.gif) top;
    width: 63px;
    height: 34px;
}

#button_a:hover {
    background: url(rolloverimage.gif) bottom;
    width: 63px;
    height: 34px;
}

#button_b {
    display: block;
    background: url(rolloverimage.gif) top;
    width: 63px;
    height: 34px;
}

#button_b:hover {
    background: url(rolloverimage.gif) bottom;
    width: 63px;
    height: 34px;
}

Can be utilized by simply assigning "class="button_a"" or "class="button_b"" as needed to assign different styles to different buttons.

Edit: or y'know take out the "_"'s and you should end up with a,b,etc button types, I may be reading the original wrong because it's way too warm here and my brain's melted :P

Hope this helps :) Please mark as solved if it resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Easiest way to do that... is to add a new DIV.

Make the new Div your tiled wave background and set the background color of your body to match the color you want to 'extend' below the wave tile.
CSS:

#BodyBG {
        margin-top: 0;
	background-color: #CCC;
}
#BG {
	margin-top: 0;
	background-repeat: repeat-x;
	background-image: url(imgs/bg_patt.png);
}
#Content {
	width:800px;
	margin-left:auto;
	margin-right:auto;
	padding: 0 0 0 0;
}

Page:

<style type="text/css">
<!--
@import url("resStyles.css");
-->
</style>
<body id="bodyBG">
<div id="BG">
<div id="Content">
--Your Centered Content Goes Here
</div>
</div>
</body>

Of course you need to change your import statement to match the name and location of your .css file and the background image URL to match your background tile.

The above should set your body background to #CCC which is a grey variant (set to whatever grey matches the bottom of your tile), set your first DIV to give your tiled background horizontally and set your second DIV to position your content cenrally on the page.

Hope this helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

The problem is the "," within the number I believe.

A messy workaround (because I am sleepy due to the excessive heat here atm) would be the following:

string[] labelSplit = label_Start_Miles1.Text.Split(',');
string labelNew = "";
for (int a = 0; a < labelSplit.Length; a++)
{
    labelNew += labelSplit[a];
}
int32 newInt = Convert.ToInt32(labelNew);

That might work for you, at least I hope it does :) it should pull out all the commas in your numeric value allowing it to be converted. The only problem you might have from there is the decimal value, if there's anything to the right of the decimal it may want you to be using double or decimal instead of int.

Hope this helps :) Please mark as solved if it resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I assume that what you are looking to do is put the phone number from the selected comboBox item into textBox1?

If so then you need to set up a SelectedIndexChanged event handler for the comboBox and in that event handler it should have an assignment of comboBox1.SelectedValue.ToString() to your textBox1.Text.

Something like this:

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        textBox1.Text = comboBox1.SelectedValue.ToString();
    }

Otherwise, from what you're doing it almost looks as though you're trying to put EVERY value of the phone column of the data source into your textbox and you're selecting the string "phone" instead of selecting the actual value component of anything.

Hope this helps :) Please mark the thread solved if this resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I would handle it in the following way:

For your CSS stylesheet -

#bodyBG {
	margin-top: 0;
	background-repeat: repeat-x;
	background-image: url(imgs/bg_patt.png);
}
#Content {
	width:800px;
	margin-left:auto;
	margin-right:auto;
	padding: 0 0 0 0;
}

For your page -

<style type="text/css">
<!--
@import url("resStyles.css");
-->
</style>
<body id="bodyBG">
<div id="Content">
--Your Centered Content Goes Here
</div>
</body>

You can play with adding an additional background-image and background-repeat: repeat-y; to have a secondary background of sorts that will tile downwards with the length of your content inside the #Content class if you like as well.

The above code sample will basically tile horizontally your wave background while setting up a secondary div container of 800px width that 'floats' horizontally centered on the page depending on the width of the inside of the browser window displaying it.

Hope this helps :) Please mark as solved if this resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

This library entry at msdn.microsoft.com might get you closer to what you're looking for if you're looking for a graphical output based on your data. At the least it should get you closer to what you need even if you need to modify the sample method they provide to fit your needs.

Hope this helps :) Please mark as solved if it resolves your issue.