Click here to Skip to main content
15,399,440 members

Comments by Computer Wiz99 (Top 200 by date)

Computer Wiz99 2-Mar-22 10:05am View
   
Thanks. I found it and updated my solution.
Computer Wiz99 17-Mar-21 11:08am View
   
Thanks again.
Computer Wiz99 17-Mar-21 10:37am View
   
Thanks. How can I hide the other options and what is the difference in using attr vs prop?
Computer Wiz99 2-Mar-20 13:10pm View
   
Okay, thanks. I understand the way you showed me but will this work for a Gridview that is populated from a database?
Computer Wiz99 2-Mar-20 12:14pm View
   
I'm sorry, What?
Computer Wiz99 2-Mar-20 10:53am View
   
Thanks for the SQL Injection part. Do you know how to help me with my issue at hand?
Computer Wiz99 31-Jan-20 11:08am View
   
Okay, I wasn't asking for someone to do it for me. I did ask how can I convert this to C#. I am not strong with VB that is why I asked and i have never saw a VB program on an Excel file. I have taken some excel files and imported them to SQL Database but never seen one like this. So, again I am not asking someone to do the conversion for me. I am trying to learn it on my own but needed help on doing so. Thanks.
Computer Wiz99 23-Jan-20 10:55am View
   
So I am replacing my code with this:

float c, d;

if (!float.TryParse(TextBoxTBS1.Substring(1), out c))
{


}
if (!float.TryParse(TextBoxTBS2.Substring(1), out d))
{

}
but I have an error with TextBox1.Substring(1). I get the red line under it. So where does the subtraction take place?
Computer Wiz99 23-Jan-20 10:23am View
   
I replace them and still get the same issue.
float c = float.Parse(TextBoxTBS1.Text.Replace(",", "").Replace(".", "").Replace("$", ""));
float d = float.Parse(TextBoxTBS2.Text.Replace(",", "").Replace(".", "").Replace("$", ""));
Computer Wiz99 23-Jan-20 9:45am View
   
Sorry about the long wait and the missing data. This is a subtraction calculation.

float c = float.Parse(TextBox1.Text.Replace(",", "").Replace(".", "")); //$46,534,798.18

float d = float.Parse(TextBox2.Text.Replace(",", "").Replace(".", "")); //$44,441,222.00

TextBox3.Text = (c-d).ToString(); //4.65348E+11
Computer Wiz99 14-Nov-19 16:45pm View
   
Thanks. I have been looking at this code for to long. It is the simple things.
Computer Wiz99 14-Nov-19 13:20pm View
   
Thanks for the update. I did make the changes. Now when I run the program I get a System.ArgumentException: 'Column 'TABLE_NAME' does not belong to table MetaDataCollections.' and here is where is happens: string sheet1 = excel_con.GetSchema().Rows[0]["TABLE_NAME"].ToString();
Computer Wiz99 14-Nov-19 9:17am View
   
Hello MadMyche. Thanks for the information. This is what I have:

<configuration>
<connectionstrings>


<add name="AkinTestConnectionString" connectionstring="Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties='Excel 8.0;HDR=YES'">

Computer Wiz99 15-May-18 9:04am View
   
Hello F-ES Sitecore. Thanks for the info. The TextBox1.Text.Replace(",", "") code is for removing the commas that the system adds in when the when the focus is set to another textbox so the calculations will fire. What I was trying to do is to have it to where the user can not enter nothing else but numbers. It works on one textbox but I get the error I posted when the textbox that does the calculations fires. So if I enter 10500 it turns to 10,500 no problem and the calculations fire. When I enter 10500.69 it gives me the error that I posted. I trying to get it to where if the user enters a number like 10500.69 that the code will fire correctly, do the calculations and correct the number to 10,501.
Computer Wiz99 18-Oct-17 11:06am View
   
What is the best way on using a filter by the code I am using?
I know how to do it on the ASP side using the Grid view Properties but never did it in C# when building the Gridview.
Computer Wiz99 5-Oct-17 9:43am View
   
Thanks. I have fixed the issue with the SQL Injection.
Computer Wiz99 3-Oct-17 10:49am View
   
Thanks. Will this also work if I use it in a If Else statement?
Computer Wiz99 8-Sep-17 14:21pm View
   
I have updated.
Computer Wiz99 23-Jun-17 12:07pm View
   
I have done that but it still exports to excel with the paging. Not the full database is exported.
Computer Wiz99 22-Jun-17 14:00pm View
   
Thanks. This is how I am enabling paging.
<asp:GridView ID="GridView2" runat="server" AllowPaging="True" 
                        AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
                        DataSourceID="SqlDataSourceTrueSubmitted" ForeColor="#333333" GridLines="None" 
                        Height="224px" style="text-align: center">
Computer Wiz99 20-Feb-17 14:57pm View
   
Okay, so if temp = 0 for table1 then the user should be able to create a username and password.

If temp = 1 for table1 the user shouldn't be able to create a username and password.
That is how it should go.
Computer Wiz99 20-Feb-17 12:03pm View
   
I have updated the code.
Computer Wiz99 20-Feb-17 11:43am View
   
Bryian Tan, Thanks for the new code. When I tested it and it work good but when I enter a user that exists in table1, table2 and table3 the ScriptManager message comes up saying; User Name is Not Recognized by the System. Your Accreditation Liaison Officer (ALO) has permissions to this page. Please contact your ALO. Even though they are in the tables. How can I fix that?
Computer Wiz99 20-Feb-17 10:34am View
   
Okay, I have tested out on two different users accounts. On one it worked. The username exits in the table1, table2 and table3. The second didn't work. The second is in table1, table2 and table3 but no error message comes up and it allows me to create another username and password for that user. Now I have two of the same usernames in table1. I didn't change my code at all.
Computer Wiz99 20-Feb-17 10:13am View
   
Okay, I see what you are getting. Now I have one username and password in table1. I am running the program again.
Computer Wiz99 20-Feb-17 10:05am View
   
When we tested it, there were duplicates in table1 but there are not any in table2 and table3. Table1 holds the username and password. Table2 and Table3 holds the user profiles.
Computer Wiz99 14-Feb-17 10:18am View
   
So you are saying that Table1 and Table2 must have the same number of columns in order for EXCEPT to work correctly? Even if I SELECT those columns?
Computer Wiz99 14-Feb-17 9:18am View
   
Thanks for the help. I do have a question. When I use EXCEPT in other queries it works for different tables. Why do you think it started now?
Computer Wiz99 14-Feb-17 9:15am View
   
Member 12999924, I got a syntax error when running your code.

Msg 102, Level 15, State 1, Line 3
Incorrect syntax near 'MINUS'.
Computer Wiz99 16-Nov-16 16:19pm View
   
Ok, I did that and nothing happened. I can't select the rows in the table.
Computer Wiz99 16-Nov-16 15:47pm View
   
So I will have to delete the jQuery code I have and use the one you provided?
Computer Wiz99 14-Nov-16 9:59am View
   
The toggle code doesn't seem to work.
Computer Wiz99 11-Nov-16 15:15pm View
   
Okay, So how can I get the Hide and Show button to use only one button and to change text on that button?
Computer Wiz99 10-Nov-16 22:09pm View
   
Which tags are you talking about? Div id or something else?
Computer Wiz99 13-Sep-16 15:49pm View
   
David_Wimbley, Thanks for the help but I am sill getting the same error.
Computer Wiz99 13-Sep-16 15:06pm View
   
Yeah, I could use that but I can't. Can't use what we didn't go over. It might not be a good design but i am trying.
Computer Wiz99 11-Jan-16 15:46pm View
   
When adding this is where debugger says it is at. I comment it out and no error. It showed the correct answer. When it is commented back in it throws an error on that line. Like it can not add the value.
Computer Wiz99 11-Jan-16 13:49pm View
   
I made a change on a different system and still no luck. Show me a code that works. So far the code I used with the changes doesn't
Computer Wiz99 11-Jan-16 12:08pm View
   
I have made the changes but I still am having the same issues. If you notice I have not clicked on any Solved questions and showing what did work. Non of what I was told worked. If it did I would have posted it and gave the Stars and Solved notation.
Computer Wiz99 7-Jan-16 13:43pm View
   
Where should I put the Trim()?
Computer Wiz99 7-Jan-16 12:48pm View
   
When I enter 2204 I one textbox I get 245 in TextBoxTHGDR. Which is correct. But the other code that Adds each value when ever the value changes is throwing the error.

This code works:
int i = Convert.ToInt32(TextBoxTHG.Text.Replace(",", ""));
TextBoxTHGDR.Text = Convert.ToString(i / 9.0);

This code is throwing the error but at line d:
int a = Convert.ToInt32(TextBoxFTUG.Text.Replace(",", ""));
int b = Convert.ToInt32(TextBoxFTG.Text.Replace(",", ""));
int c = Convert.ToInt32(TextBoxTHUGDR.Text.Replace(",", ""));
int d = Convert.ToInt32(TextBoxTHGDR.Text.Replace(",", ""));
TextBoxT1234.Text = Convert.ToString(a + b + c + d);

Computer Wiz99 7-Jan-16 12:38pm View
   
Okay. I debugged it. Just letting it Divide and Round. I get the correct answer but it will not Add to the other numbers after the Rounding. No other charter is in the textbox. What now?
Computer Wiz99 8-Dec-15 16:06pm View
   
Okay, thanks. I will look again.
Computer Wiz99 8-Dec-15 15:47pm View
   
Where is this value? I am typing in numbers. And why is this just the only record?
Computer Wiz99 20-Nov-15 13:43pm View
   
Right but I corrected that by putting a Validation on each textbox for this check.
Computer Wiz99 20-Nov-15 10:53am View
   
What should I use instead of Convert.ToInt32? It has worked in the past. And I have 0 in all the textboxes when the page loads.
Computer Wiz99 20-Nov-15 10:10am View
   
In TextBoxTHUGDR the value is 127 when it is rounded. When I comment out the adding part it works but the other values in the other textboxes does not add the value in TextBoxTHUGDR.
Computer Wiz99 19-Nov-15 15:32pm View
   
I made the changes and it worked. Now I have an issue with Input string not in correct format with this code: int c = Convert.ToInt32(TextBox2.Text.Replace(",", ""));. Why is this happening?
Computer Wiz99 5-Oct-15 11:25am View
   
Thanks, I got it to work.
Computer Wiz99 12-Aug-15 15:05pm View
   
I have do that about four times today and noting happens. No error nor details on what is causing the code not to work right.
Computer Wiz99 12-Aug-15 14:43pm View
   
The problem is that when a user logs in for the first time there should be two links and two buttons showing. It is not. The user logs in and everything is showing. Two links, four buttons and one Label.
Computer Wiz99 12-Aug-15 13:36pm View
   
I have updated my codes.
Computer Wiz99 12-Aug-15 11:14am View
   
Thanks but it is not working. Funny thing is that this code works on another project I have but having issues with this one.
Computer Wiz99 24-Jul-15 10:45am View
   
Got it. Thanks
Computer Wiz99 24-Jul-15 10:34am View
   
Okay, So I should remove it from Page_Load and put it in the SelectedIndexChanged event?
Computer Wiz99 24-Jul-15 10:28am View
   
When the user selects a value in the DDL the textbox populates but the Label I have in place does not change until the user selects "Select Calendar" then the user can select a value and the Label changes. Why does this happen? How can I correct it?
Computer Wiz99 24-Jul-15 10:20am View
   
Thanks that worked great!!!
Computer Wiz99 11-May-15 14:43pm View
   
Yes I will but one other thing. What about resolution? As I said in my question my resolution is 1920*1080 and I debugged using 1440*900 resolution which all of my website elements were not aligned correctly. How would I fix that?
Computer Wiz99 11-May-15 12:21pm View
   
Okay I think I got it so far.
Computer Wiz99 11-May-15 11:56am View
   
I am reading the article but I am pressed for time on this site. Any other speedy way?
Computer Wiz99 11-May-15 11:27am View
   
Okay. I really don't have the time to try to learn the information you gave me right now. I will read up on it after I get this fixed. Is there a way to fix this in C# or HTML without using the way you gave me?
Computer Wiz99 11-May-15 10:59am View
   
I could not see your past answer because the post was closed.
Computer Wiz99 8-May-15 13:25pm View
   
I really don't have anything to show but the HTML code for each page.
Computer Wiz99 6-May-15 12:14pm View
   
Thanks. I will look into it deeper.
Computer Wiz99 6-May-15 11:36am View
   
Yes, I got that part but how am I passing that data when the other forms don't? They are all the same except each form asks for different information. This form is shorter but needs some of the same data where the other forms are longer needing more data. The data goes to the same database. So if the other two forms don't have this error, why does this one?
Computer Wiz99 5-May-15 9:56am View
   
Psima, Thanks but the connection was not my issue for this not to work. Right now it just checks to see if the record exists. How can I have it to check to see if a value exist and depending on the value the other code works?
Computer Wiz99 4-May-15 11:39am View
   
Yes, I have that part but to check to see if the Submit column is True or False. If the Submit column has True in it the Submit button will hide. If the Submit column has False in it the Submit Button is shown. Right now the code I have just checks for the record to see if it exists. How can I have it to check to see if the Submit column is True or False?
Computer Wiz99 4-May-15 11:23am View
   
He changed the database to where instead of two tables we now have one. I had two tables. One that has all of the general information and the other that just stored the general information. That way the user can go back and update different fields before they submit it. Then when that was finished the user can click the submit button and the record from my saved table will then copy into the general table. That is the way I know to show it was submitted.
Computer Wiz99 4-May-15 11:20am View
   
I have one of those Boss that wants to change things. The Submit column will tell him if the record is submitted or not. So I made it a True, False column. Why, I don't know.
Computer Wiz99 2-Feb-15 16:05pm View
   
Okay, Thanks.
Computer Wiz99 23-Jan-15 13:22pm View
   
I used the code you gave and I Executed it and it said that 771 row affected. I did a refresh of the table and there is no data in column LName. What did I do wrong this time?
Computer Wiz99 23-Jan-15 13:05pm View
   
I don't get an error. It inserts the data but puts it a new column at the bottom of the table. It adds more records to the table and not inserting it in the right place.
Computer Wiz99 18-Nov-14 12:43pm View
   
OriginalGriff, that worked. Thanks. Do I have to change all of the int to Double in my code or just for the rounding?
Computer Wiz99 18-Nov-14 8:42am View
   
Okay, the ispostback..., Are you saying in the code behind or the properties of the GridView?
Computer Wiz99 18-Nov-14 6:23am View
   
Do you mean for the GridView?
Computer Wiz99 17-Nov-14 11:59am View
   
Nothing happens to the database. I checked to make sure but nothing. I also refreshed the GridView to see if it did update but nothing. Could it be my population with the Select link from the GridView?
Computer Wiz99 17-Nov-14 11:31am View
   
Yes I have a still nothing.
Computer Wiz99 14-Nov-14 8:12am View
   
I am not using DataSets. The formula is what I am using that has no dataset in it or in the code behind.
Computer Wiz99 14-Nov-14 5:53am View
   
Okay, now can you do the same thing and put 4461 into TextBooxLYTHCAS and put 321 in TextBoxTHCAS. You will get 93. 93 is a decrease percentage from 4461. How can I correct this error? I know the calculations is doing what it is suppose to do but if a value that is entered into TextBoxTHCAS is less than the value in TextBoxLYTHCAS do not calculate. Is that possible?
Computer Wiz99 14-Nov-14 5:47am View
   
Where did you get this code from? Do I put the text part in the front of the formula?
Computer Wiz99 13-Nov-14 20:58pm View
   
I'm sorry I don't follow you.
Computer Wiz99 13-Nov-14 15:00pm View
   
How can I setup CV in my case. I have a code that runs the RangeValidator when the page loads.
Computer Wiz99 13-Nov-14 14:51pm View
   
How do I combine the two validators into one? In my case I don't think I can do that. I have another code that handles the rangevalidators.
Computer Wiz99 13-Nov-14 14:38pm View
   
Check out my error update.
Computer Wiz99 13-Nov-14 14:26pm View
   
I tried that expression also and get the same error. What I am trying to do is to have the user to enter a letter whether it is u9932, 98t4. 9ngnmd or 23h345. I want the error to show and not crash the system. I don't know if the textbox text change might have something to do with it.
Computer Wiz99 13-Nov-14 12:12pm View
   
Richard Deeming, I get this error:
Must declare the scalar variable "@FT_UNDERGR".
Computer Wiz99 13-Nov-14 9:37am View
   
Okay, I corrected the code but still get the same error message.
Computer Wiz99 12-Nov-14 10:02am View
   
Can I update my code to show you what I have changed? Please unlock it.
Computer Wiz99 12-Nov-14 10:00am View
   
I see what you are saying, I think.....updated code.
Computer Wiz99 12-Nov-14 9:58am View
   
I would have used that answer if it worked and was clear enough.
Computer Wiz99 12-Nov-14 9:55am View
   
There is one for the iTextBoxFTE40 for a report by itself.
Computer Wiz99 12-Nov-14 9:54am View
   
Yes I know. The first iTextBoxHC50 and iTextBoxFTE40 is a combined IF statement for one report and the other iTextBoxHC50 is a report by itself.
Computer Wiz99 12-Nov-14 9:52am View
   
I have added a code that I have used in another project. Can I use that one and still get the right out come?
Computer Wiz99 12-Nov-14 9:23am View
   
That is what I am looking for but am suck on how to put it on a button. I did it on a textbox text change before but not a button. Is it more code to do or do I have to write something different?
Computer Wiz99 11-Nov-14 13:31pm View
   
What I am trying to do is to do the calculation for the textbox text change if the user only enters zero. I have uploaded my code for the calculations.
Computer Wiz99 11-Nov-14 12:52pm View
   
I have a question. Is there a way for me to do a calculation just by entering zero if there is a zero in the textbox for the textbox text change?
Computer Wiz99 11-Nov-14 10:49am View
   
Ok, When the user enter the form the textboxes has zeros in them already. The user has to enter their data into the textboxes. When they come to a textbox that has a zero in it and they have no data to enter into that textbox the text change does not work. Only time it works is when the user enters zero twice and then goes to the next textbox. How can I get the text change to work if a user has nothing to enter into that textbox that has the text change on it?
Computer Wiz99 11-Nov-14 10:31am View
   
I have them in Page Load to check the values of the data that is populated.
Computer Wiz99 11-Nov-14 10:15am View
   
I did that part but still will need to have a value when the page loads.
Computer Wiz99 11-Nov-14 10:09am View
   
Range Validators. What I want to do and tring to do is to show the zeros when the web form loads but disappear when the user enters a value. Is there a way to do this in C#?
Computer Wiz99 11-Nov-14 9:58am View
   
There is a problem with that. When the web form loads there are validators that load with it. Errors will show up before the form even loads completely.
Computer Wiz99 5-Nov-14 21:19pm View
   
I have this code here:
ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect", "var r = confirm('Data updated successfully. You will now redirected to search page.'); if (r == true) var str= 'Login.aspx'; location.href = 'Gradrate.aspx' ;", true);

It does not redirect to the pages.
Computer Wiz99 4-Nov-14 13:32pm View
   
That is all I was missing. This was not a double question. Just need some fresh eyes on it to see what I did wrong or missed. Thanks.
Computer Wiz99 4-Nov-14 13:24pm View
   
I did that and still getting this error. It only happens on this line of code. Plus, that was not my question before. I asked about something else. Not about this new error.
Computer Wiz99 4-Nov-14 11:46am View
   
Right now the data is saved into a table called table44. It is not the real table. It just holds the data until it is transferred to the real database and tables. I just need the user to insert their data if it doesn't exist and update if it does exist under the same button function.
Computer Wiz99 4-Nov-14 10:55am View
   
Peter Leow, So my code should look like this: See my solution.
Computer Wiz99 3-Nov-14 12:54pm View
   
The values come from a calculation that the user puts in earlier in the numbers that was entered. Then the values are saved into the database then then they are populated back to the textboxes for the print button to get the value from.
Computer Wiz99 3-Nov-14 9:09am View
   
I understand what you are saying but I don't know Javascript that well. The Values are also in the database. I populate them to three different textboxes. All I am trying to do is if textbox1 value is > 40 print page 1. If textbox2 value is > 50 print page 2. If textbox3 value is > 150 print page 3. I am trying to do this in C#.
Computer Wiz99 30-Oct-14 13:46pm View
   
How when selecting? Plus, is my SQL statement right for writing code to another table?
Computer Wiz99 30-Oct-14 11:38am View
   
ReportFormFTE.aspx

Computer Wiz99 30-Oct-14 11:28am View
   
Ok. I will try this. Thanks.
Computer Wiz99 30-Oct-14 11:05am View
   
PrintMe2 did not work. I also tried to rename the window.open to window.open2 but nothing happened.
Computer Wiz99 30-Oct-14 10:57am View
   
Ok. I have removed that and still no two CR Viewer.
Computer Wiz99 30-Oct-14 10:56am View
   
Okay, new to this. How and where will I move my code?
Computer Wiz99 30-Oct-14 10:30am View
   
Yes, they are two different reports in two different CR viewers. One is ReportFormFTE.aspx and the other is ReportFormGrad.aspx. Do I need to put the code together?
Computer Wiz99 29-Oct-14 15:04pm View
   
Sorry about that but I took the If Else statement out. Thinking that was why it was not working but no. It works on my other projects.
Computer Wiz99 29-Oct-14 15:02pm View
   
Is there a way to add an ok button and cancel button. Ok button will redirect to another page and the cancel will let the user stay on the current page.
Computer Wiz99 29-Oct-14 12:36pm View
   
Where do I enter the filter formula for the Year in CR v2013?
Computer Wiz99 29-Oct-14 11:57am View
   
If I do it in a Grid View, how can I get those values from the Grid View to the another database when the user clicks Submit button?
Computer Wiz99 29-Oct-14 10:27am View
   
I have updated my code.
Computer Wiz99 29-Oct-14 10:13am View
   
I can populate textboxes from a database without the Unit Id but since the Unit ID and the User ID are connected, How can I populate multiple textboxes if the Unit Id is different for that user?
Computer Wiz99 29-Oct-14 9:45am View
   
All the records into different textboxes. Example:
If there is a record that matches User ID 100 and the Unit ID is 200, all of the data in that record should populate into one set of textboxes. Right now I have 5 sets of textboxes to populate 5 records that match User ID 100.

Can you follow me?
Computer Wiz99 29-Oct-14 9:36am View
   
Thanks. This will help out a lot.
Computer Wiz99 29-Oct-14 8:22am View
   
The code you gave is for the code behind right? What about on the program that makes a CR? I have reports that I designed in SAP CR 2013. Is there a formula that I can put together like in Formula Fields to filter out the year I need?
Computer Wiz99 28-Oct-14 15:31pm View
   
Ok, Is there a textbox property to do this or do I need a code behind?
Computer Wiz99 28-Oct-14 10:36am View
   
Bruno Santos Oliverira, I am not using a Decimal. I don't need a decimal.
Computer Wiz99 28-Oct-14 10:29am View
   
No. Look at my update.
Computer Wiz99 28-Oct-14 10:17am View
   
I got what you are saying. I also have this code to remove the commas during the validation: Convert.ToInt32(TextBox1.Text.Replace(",", "")); Then the format is placed back in the numbers.
Computer Wiz99 28-Oct-14 10:07am View
   
I took the format out and the submission worked. Is there any way to rewrite the format code and still get the format?
Computer Wiz99 28-Oct-14 6:15am View
   
Duncan Edwards Jones, I did that as well as putting a textbox on the web form to see what were the values of the min and max. Depending on the number from last year the min and max values change. But the other rangevalidators do not fire when the Submit button is clicked. They fire when they supposed to but not on Submit button. I just want the four rangevalidators not to fire on Submit button but still validate the web page. I know I can bypass this by setting the Submit button to CausesValidation="False" but I don't want that to happen.
Computer Wiz99 27-Oct-14 13:42pm View
   
Ok, but if I put Where INST_ID = 1 then won't that look for a value of 1 in the database?
Computer Wiz99 27-Oct-14 13:37pm View
   
Yes it is. It is what connects the data to that user.
Computer Wiz99 27-Oct-14 11:40am View
   
I had the correct Delete Statement before but it still didn't work. Thanks for the links.
Computer Wiz99 27-Oct-14 9:57am View
   
It is not working. I have uploaded the code edit.
Computer Wiz99 26-Oct-14 18:26pm View
   
Garth J Lancaster, I like option A. How would I code that?
Computer Wiz99 24-Oct-14 16:36pm View
   
I don't know jquery. Can n uou give me an example.
Computer Wiz99 24-Oct-14 5:22am View
   
I am using an if else statement in the code. It works on other projects I have done.
Computer Wiz99 24-Oct-14 4:42am View
   
Yes. I use the same code on other projects. Why has it stopped now.
Computer Wiz99 23-Oct-14 11:55am View
   
Sidtrey, I don't know how to use AJAX. I think I got it working so far.
Computer Wiz99 23-Oct-14 9:12am View
   
That is why I am stuck. I didn't think anyone understood my question.
Computer Wiz99 22-Oct-14 15:03pm View
   
I still want the user to see the errors when they are going through the web form. Just that the errors will fire to show the user all of the errors before they save. The submit button still works normal.
Computer Wiz99 22-Oct-14 15:01pm View
   
I tried to Google it but I guess I am not asking it right.
Computer Wiz99 22-Oct-14 14:54pm View
   
How do you mean?
Computer Wiz99 22-Oct-14 12:04pm View
   
How do you mean?
Computer Wiz99 22-Oct-14 11:40am View
   
Is there a way to have a validator to fire and give a value like 1 to be saved in the database? So that next time the user logs in and the form is populated the error will show and that user can print a report with that error on it?
Computer Wiz99 22-Oct-14 11:35am View
   
That works. Thanks. Had to change some other ones when testing.
Computer Wiz99 22-Oct-14 10:38am View
   
CHill60, So in my code I am deleting this line, int iminVal13 = (itxtVal13 * 0);, and replacing this line, RangeValidatorLYFTE4050.MinimumValue = iminVal13.ToString();, with the line you gave me? RangeValidatorLYFTE4050.MinimumValue = iminVal13.ToString();
Computer Wiz99 21-Oct-14 12:04pm View
   
Okay. Change the variable names to match the textbox names? Meaning,
int iTextBoxValue = Convert.ToInt32(TextBox1.Text); to
int iTextBox1 = Convert.ToInt32(TextBox1.Text);?
Computer Wiz99 21-Oct-14 11:45am View
   
Any help at all?
Computer Wiz99 21-Oct-14 10:58am View
   
Sorry about that. Textbox2 has one value. Textbox2 value will be 40. Basically the 40 is 40%. I have a calculation that finds out the percentage difference between two numbers and that answer will be in textbox2. The same with textbox3. Each textbox will fire the validator if the value is higher than 40 in textbox2 and one will fire if the value is higher than 50 in textbox3. The error message that shows will let the user know that their numbers calculate more than 40 and that they will have to explain this on the report that should print out for that error. SO on with the 50 in textbox3.
Computer Wiz99 21-Oct-14 10:44am View
   
Textbox has a value of 0 which should print out the original report
Textbox2 has a value of 40 which should print out the 40 report
Textbox3 has a value of 50 which should print out the 50 report
Textbox4 has a value of 90 which should print out the 90 report

Textbox4 has the sum of textbox2 and textbox3. The reports lets the user know that they will have to explain why this is so. If the report is normal then the user will not have to explain. What is the best way to do this?
Computer Wiz99 21-Oct-14 10:25am View
   
What I have on the web form should not give a user a choice. When the user enters their data and the calculations are done, the validators are fired if the users calculation is more than what was inputted then last year. If a user's data from last year was 100 and this year they enter 121. This will fire the vaidator because it is a 20% increase from last year. Which will then let the user print a report because of this value. What other way can this be done?
Computer Wiz99 20-Oct-14 23:05pm View
   
I already do rounding. Look at my code for the rounding.
Computer Wiz99 20-Oct-14 22:39pm View
   
pwasser, Thanks for the code. I have one more question. How do I round to the whole number to get rid of the decimal and the numbers after that?
Computer Wiz99 20-Oct-14 12:06pm View
   
First thing is that the link I showed you was what I was looking for. If you enter in two numbers on that link you will get back the same answer. Not a negative. Check it out:

Calculate percentage difference
between V1 = 100 and V2 = 1000

( | V1 - V2 | / ((V1 + V2)/2) ) * 100

= ( | 100 - 1000 | / ((100 + 1000)/2) ) * 100
= ( | -900 | / (1100/2) ) * 100
= ( 900 / 550 ) * 100
= 1.636364 * 100

= 163.6364% difference

And if I do it like this:

Calculate percentage difference
between V1 = 1000 and V2 = 100

( | V1 - V2 | / ((V1 + V2)/2) ) * 100

= ( | 1000 - 100 | / ((1000 + 100)/2) ) * 100
= ( | 900 | / (1100/2) ) * 100
= ( 900 / 550 ) * 100
= 1.636364 * 100

= 163.6364% difference

Same answer with no negative.
Computer Wiz99 20-Oct-14 12:05pm View
   
First thing is that the link I showed you was what I was looking for. If you enter in two numbers on that link you will get back the same answer. Not a negative. Check it out:

Calculate percentage difference
between V1 = 100 and V2 = 1000

( | V1 - V2 | / ((V1 + V2)/2) ) * 100

= ( | 100 - 1000 | / ((100 + 1000)/2) ) * 100
= ( | -900 | / (1100/2) ) * 100
= ( 900 / 550 ) * 100
= 1.636364 * 100

= 163.6364% difference

And if I do it like this:

Calculate percentage difference
between V1 = 1000 and V2 = 100

( | V1 - V2 | / ((V1 + V2)/2) ) * 100

= ( | 1000 - 100 | / ((1000 + 100)/2) ) * 100
= ( | 900 | / (1100/2) ) * 100
= ( 900 / 550 ) * 100
= 1.636364 * 100

= 163.6364% difference

Same answer with no negative.

Computer Wiz99 20-Oct-14 11:49am View
   
Manfred R. Bihy, Thanks for the code but there is a problem with the second one. Plus I want the code to give the difference between tow numbers no matter how they are entered. Here is a link of what I am trying to do:

http://www.calculatorsoup.com/calculators/algebra/percent-difference-calculator.php
Computer Wiz99 17-Oct-14 12:04pm View
   
Thanks
Computer Wiz99 17-Oct-14 11:11am View
   
Never used it before. How would that be setup?
Computer Wiz99 16-Oct-14 15:13pm View
   
OriginalGriff, Thanks for the code. I was just trying to find a shorter way of coding for rounding numbers to the nearest whole number without using Boolean. You are right I do have a habit of converting strings into other strings. I just have a weird idea in my head. Just testing it out to see what I can come up with. Being on here has helped me to retract and redo some coding and make it better. My wife said that I am like a code scientist. :laugh:
Computer Wiz99 16-Oct-14 14:52pm View
   
on the line: TextBox2.Text = Math.Round(Convert.ToString(TextBox2.Text), 2);,
Math.Round(Convert.ToString(TextBox2.Text), 2); has a red line under it. Error saying: The best overloaded method match for 'System.Math.Round(decimal)' has some invalid arguments. And the second error says: Argument 1: cannot convert from 'string' to 'decimal'. I am just trying to round to the nearest whole number.

Computer Wiz99 15-Oct-14 9:50am View
   
Here is my Page Load code:

protected void Page_Load(object sender, EventArgs e)
{

this.TextBoxDATE.Text = DateTime.Today.ToString("dd-MMM-yy");
this.lblTime.Text = System.DateTime.Now.ToShortTimeString();


TextBox1.Text = string.Format("{0:0,0}", double.Parse(TextBox1.Text));
TextBox2.Text = string.Format("{0:0,0}", double.Parse(TextBox2.Text));
TextBox3.Text = string.Format("{0:0,0}", double.Parse(TextBox3.Text));
TextBox4.Text = string.Format("{0:0,0}", double.Parse(TextBox4.Text));
}

Computer Wiz99 15-Oct-14 9:29am View
   
The format is in the Page load event.
Computer Wiz99 13-Oct-14 16:13pm View
   
That works for me. Question, what is the best way to round value?
Computer Wiz99 13-Oct-14 10:45am View
   
This is the code I have behind for the RangeValidator:

double txtVal6 = Convert.ToDouble(TextBoxLYFTUG.Text);
double minVal6 = (txtVal * 0.8);
double maxVal6 = (txtVal * 1.2);
RangeValidatorLYFTUG.MinimumValue = minVal6.ToString();
RangeValidatorLYFTUG.MaximumValue = maxVal6.ToString();
Computer Wiz99 13-Oct-14 10:09am View
   
Thanks for the code. I was looking at something when you asked me about the Autopostback. I have the autopostback for the first two textboxes because of the format. When the user enters 2000 and tabs to the next textbox it would change to 2,000. I have a code behind that does the calculations for the rangevalidator to see if the values are 20% higher/lower from the original value. When I removed the autopostback the validator worked but the format stopped working.
Computer Wiz99 13-Oct-14 9:48am View
   
I have tried it but with no luck on my part. Maybe I am doing something wrong.
Computer Wiz99 13-Oct-14 9:25am View
   
Thanks. Can you explain to me why did the range validator stop working when I formatted the textbox with the string code?
Computer Wiz99 13-Oct-14 9:00am View
   
Okay. How would the Custom Validator work in this? I never used it.
Computer Wiz99 13-Oct-14 8:54am View
   
I don't think I would need the CompareValidator. I am not comparing anything. The validator should fire if the value is 20% higher/lower.

Ex.

Textbox1 has a value of 100 and the user enters 121 in textbox2. The validator should fire because the value in textbox2 is 20% higher then the value in textbox1.
Computer Wiz99 13-Oct-14 6:32am View
   
I see what you are saying but can't make changes like that right now. I think the format of the textbox is what threw it off. How can I get tge validator to except commas?
Computer Wiz99 13-Oct-14 6:09am View
   
Some of tge textboxes do calculations. The first two textboxes don't.
Computer Wiz99 13-Oct-14 5:51am View
   
When the user enters their data and tab to the next textbox it should fire. This needs to happen without clicking the submit button. It was working before I formatted the textbox.
Computer Wiz99 12-Oct-14 23:56pm View
   
Sorry for the long wait but had to sleep. I am trying to get numbers in the textboxes and the value of them. I can't use comboBox or dropdown list. I do a calculation to get the numbers I need in the textbox in order to do the different printing.
Computer Wiz99 12-Oct-14 9:59am View
   
That is not working. i changed it to (TextBoxFTE4050.Text.Trim().Value < 40) and get an error on the Value part.
Computer Wiz99 12-Oct-14 9:54am View
   
Okay. I think I see what is wrong now. It should be (TextBoxFTE4050.Text.Trim().Value < 40).
Computer Wiz99 10-Oct-14 11:39am View
   
Where would I put Page.IsValid() in code behind? I did change the properties to the validation but is still not working.
Computer Wiz99 10-Oct-14 10:48am View
   
Thanks hypermellow. Will this also reset the error message when the user changes the number? EX: If the user enters 12,345 and the error displays and the user should have entered 123,456. Will the error go away?
Computer Wiz99 8-Oct-14 16:13pm View
   
What do you mean?
Computer Wiz99 8-Oct-14 9:33am View
   
George Jonsson, where will I apply this code? In Textbox_text change?
Computer Wiz99 7-Oct-14 11:30am View
   
I just wanted to see where the Int32TryParse will go. Plus, is there a way for the format to be entered after the calculations?
Computer Wiz99 7-Oct-14 11:20am View
   
Maciej Los, thanks for the link. Can you show me how this would work in my code?
Computer Wiz99 6-Oct-14 16:15pm View
   
Okay, Thanks. I will try another way.
Computer Wiz99 6-Oct-14 16:02pm View
   
I understand that part but show me what it will look like even if it has to be changed.
Computer Wiz99 6-Oct-14 15:50pm View
   
Okay, show me a code in C# where the textbox can auto input commas when the user enter numbers and it also does the calculations on different textboxes. I tried to use jQuery with no luck.
Computer Wiz99 6-Oct-14 15:34pm View
   
Okay, I got the don't use .Trim() method. Can you show an example of the IsInt() method?
Computer Wiz99 6-Oct-14 15:29pm View
   
So do I put the .Trim() method on the calculation code or the formatted code?
Computer Wiz99 6-Oct-14 15:07pm View
   
Afzaal Ahmad Zeehan, Thanks for the post. Where would I put the use.Trim() in my code to get just the numbers?
Computer Wiz99 2-Oct-14 14:04pm View
   
Ok. Is there a better way to format the numbers in a textbox without using jQuery?
Computer Wiz99 2-Oct-14 5:26am View
   
I have updated the code. Please help.
Computer Wiz99 1-Oct-14 15:30pm View
   
You need the html code and the C# code?
Computer Wiz99 1-Oct-14 15:06pm View
   
Can you show me?
Computer Wiz99 1-Oct-14 14:54pm View
   
Okay. So the code I have will still work? If that is the case then when the user clicks on the submit button the database has zero in it?
Computer Wiz99 1-Oct-14 14:26pm View
   
The program is in C# but I am using jQuery to just mask the data that is in the textbox so that the user can see what they are typing better. I just need to unmask it and save it to the database. What is the C# code to get the value from the unmasked textbox to the database?
Computer Wiz99 1-Oct-14 12:02pm View
   
Afzaal Ahmad Zeeshan, is there another way of doing this with c#? I really don't know jQuery that well. I am using VS 2010 with c#. I use jQuery to just mask the textboxes to help the user to see the numbers entered better.
Computer Wiz99 30-Sep-14 15:50pm View
   
I mask the value in TextBox1 and then I unmask it to lblinfo when the user clicks or tabs to the next field. Just to show how the unmasking works. I just wanted to know why can't it display the unmask in a textbox?
Computer Wiz99 30-Sep-14 11:29am View
   
I have this code to work but it starts off to the left and not the right.
How can I fix this?

$.mask.definitions['~'] = "[+-]";
$("#TextBox1").mask('?999,999,999,999');
$("#TextBoxY").mask('?999,999,999,999');
Computer Wiz99 30-Sep-14 11:17am View
   
Tadit Dash, So I will have to put a "?" after all characters like this:

<pre lang="HTML">
jQuery(function($){
$("#phone").mask("(9?9?9?) 9?9?9?-9?9?9?9? x9?9?9?9?9?");
});
</pre>
Computer Wiz99 30-Sep-14 11:14am View
   
Yes.
Computer Wiz99 29-Sep-14 15:55pm View
   
This is what I am trying to find out. The jQuery I have masks textbox1 and textboxY. The code looks like this for both masked textboxes:

$("#TextBox1").mask("999,999,999,999");
$("#TextBoxY").mask("999,999,999,999");

A user can enter 123,456,789,101 and the format will unmask and display to the right of the textbox. What if the user only enters 123,456. The masked numbers disappears when going to another textbox. How can I get the code to the point to where it will mask any number without entering all of the numbers required?