Click here to Skip to main content
15,889,361 members
Home / Discussions / C#
   

C#

 
GeneralRe: SqlServerCeException "There was an error parsing the query" help .... Pin
Md. Marufuzzaman1-Oct-09 20:15
professionalMd. Marufuzzaman1-Oct-09 20:15 
Questionsocket problem: works in visual studio, not as release Pin
TimWallace1-Oct-09 5:49
TimWallace1-Oct-09 5:49 
AnswerRe: socket problem: works in visual studio, not as release Pin
Luc Pattyn1-Oct-09 6:22
sitebuilderLuc Pattyn1-Oct-09 6:22 
GeneralRe: socket problem: works in visual studio, not as release Pin
TimWallace1-Oct-09 6:56
TimWallace1-Oct-09 6:56 
GeneralRe: socket problem: works in visual studio, not as release Pin
Luc Pattyn1-Oct-09 7:09
sitebuilderLuc Pattyn1-Oct-09 7:09 
General[SOLVED] Re: socket problem: works in visual studio, not as release Pin
TimWallace1-Oct-09 8:34
TimWallace1-Oct-09 8:34 
GeneralRe: [SOLVED] Re: socket problem: works in visual studio, not as release Pin
Luc Pattyn1-Oct-09 8:41
sitebuilderLuc Pattyn1-Oct-09 8:41 
QuestionMethod not calculating properly‏ Pin
Marcus Farrugia1-Oct-09 5:09
Marcus Farrugia1-Oct-09 5:09 
Hi, I'm creating an asp.net Pizza order form using c# for a night school course and I have a RadioButtonList for the Size of the pizza and a checkbox list for the Pizza Toppings. Both controls have autopostback enabled so that as a size is selected and a topping is added the Total Price label will automatically calculate the total price and size is selected and toppings added. I have a simple method that adds the ingredients price to the size price as selctions are made. The problem is that the value of the Total Price changes as selections are made to the size (2,4,6,8,10) but if a topping is selected then the value of the total price doesn't add the size price to the toppings price they are still calculated individually, can someone tell from my code how i can write and use my method to total the size price with the topping price? thanks in advance.
<br />
public partial class _Default : System.Web.UI.Page <br />
{<br />
    decimal TotalPrice = 0;<br />
    decimal IngredientsPrice = 0;<br />
    decimal SizePrice = 0;<br />
<br />
    private decimal MethodTotalPrice(decimal MethodIngredientsPrice,<br />
        decimal MethodSizePrice)<br />
    {<br />
        decimal MethodTotalPrice;<br />
        MethodTotalPrice = MethodIngredientsPrice + MethodSizePrice;<br />
        return MethodTotalPrice;<br />
    }<br />
<br />
    protected void Page_Load(object sender, EventArgs e)<br />
    {<br />
        <br />
    }<br />
    protected void RadioButtonList1_SelectedIndexChanged1(object sender, EventArgs e)<br />
    {<br />
        lblSize.Text = rblSize.SelectedItem.Text;<br />
<br />
        if (rblSize.SelectedValue == "Slice")<br />
        {<br />
            lblSize.Font.Size = 8;<br />
            SizePrice = 2;<br />
        }<br />
        if (rblSize.SelectedValue == "Small")<br />
        {<br />
            lblSize.Font.Size = 10;<br />
            SizePrice = 4;<br />
        }<br />
        if (rblSize.SelectedValue == "Medium")<br />
        {<br />
            lblSize.Font.Size = 12;<br />
            SizePrice = SizePrice + 6;<br />
        }<br />
        if (rblSize.SelectedValue == "Large")<br />
        {<br />
            lblSize.Font.Size = 14;<br />
            SizePrice = 8;<br />
        }<br />
        if (rblSize.SelectedValue == "Xtra Large")<br />
        {<br />
            lblSize.Font.Size = 16;<br />
            SizePrice = 10;<br />
        }<br />
        TotalPrice = MethodTotalPrice(IngredientsPrice, SizePrice);<br />
        lblPriceTotal.Text = TotalPrice.ToString();<br />
    }<br />
    protected void cblIngredients_SelectedIndexChanged(object sender, EventArgs e)<br />
    {<br />
        string Message;<br />
        Message = "";<br />
        for (int i = 0; i < cblIngredients.Items.Count; i++)<br />
        {<br />
            if (cblIngredients.Items[i].Selected)<br />
            {<br />
                Message = Message + cblIngredients.Items[i].Text + "<br>";<br />
                IngredientsPrice = IngredientsPrice + 1;<br />
            }<br />
        }<br />
        lblIngredients.Text = Convert.ToString(Message);<br />
        TotalPrice = MethodTotalPrice(IngredientsPrice, SizePrice);<br />
        lblPriceTotal.Text = TotalPrice.ToString();<br />
    }<br />
}<br />

AnswerRe: Method not calculating properly‏ [modified] Pin
harold aptroot1-Oct-09 5:22
harold aptroot1-Oct-09 5:22 
GeneralRe: Method not calculating properly‏ Pin
PIEBALDconsult1-Oct-09 15:31
mvePIEBALDconsult1-Oct-09 15:31 
AnswerRe: Method not calculating properly‏ Pin
Luc Pattyn1-Oct-09 5:34
sitebuilderLuc Pattyn1-Oct-09 5:34 
AnswerRe: Method not calculating properly‏ Pin
J4amieC1-Oct-09 6:32
J4amieC1-Oct-09 6:32 
AnswerRe: Method not calculating properly‏ Pin
Keith Barrow1-Oct-09 7:05
professionalKeith Barrow1-Oct-09 7:05 
QuestionUploading pictures. Pin
Mix Wheels1-Oct-09 4:17
Mix Wheels1-Oct-09 4:17 
AnswerRe: Uploading pictures. Pin
Luc Pattyn1-Oct-09 4:22
sitebuilderLuc Pattyn1-Oct-09 4:22 
QuestionSearching a non-PrimaryKey column within a DataTable with a partial string. Pin
KCI-VA1-Oct-09 3:49
KCI-VA1-Oct-09 3:49 
AnswerRe: Searching a non-PrimaryKey column within a DataTable with a partial string. Pin
Eddy Vluggen1-Oct-09 10:16
professionalEddy Vluggen1-Oct-09 10:16 
QuestionRe: Searching a non-PrimaryKey column within a DataTable with a partial string. Pin
KCI-VA1-Oct-09 10:37
KCI-VA1-Oct-09 10:37 
AnswerRe: Searching a non-PrimaryKey column within a DataTable with a partial string. Pin
KCI-VA8-Oct-09 5:32
KCI-VA8-Oct-09 5:32 
QuestionWindows Forms: TreeView in SplitContainer flickers on Resizing the screen ar runtime Pin
Poornima Naik1-Oct-09 3:21
Poornima Naik1-Oct-09 3:21 
QuestionRemove program from Control panel using C# Pin
Ajithevn1-Oct-09 3:07
Ajithevn1-Oct-09 3:07 
AnswerRe: Remove program from Control panel using C# Pin
stancrm1-Oct-09 3:18
stancrm1-Oct-09 3:18 
QuestionRe: Remove program from Control panel using C# Pin
Eddy Vluggen1-Oct-09 3:48
professionalEddy Vluggen1-Oct-09 3:48 
AnswerRe: Remove program from Control panel using C# Pin
Ajithevn1-Oct-09 6:07
Ajithevn1-Oct-09 6:07 
GeneralRe: Remove program from Control panel using C# Pin
Eddy Vluggen1-Oct-09 10:07
professionalEddy Vluggen1-Oct-09 10:07 

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.