Can someone please help me with why this button is not working, I've tried putting it in <for id="" runat="server">, but then I get the error: A page can have only one server-side Form tag. When the button is clicked nothing happens. [code] <%@ Page Language="C#" MasterPageFile="~/train.master" AutoEventWireup="true" validateRequest="false" CodeFile="TrainStationTutorial.aspx.cs" Inherits="TrainStationTutorial" Title="Admin | Tutorial" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <link href="style2.css" rel="stylesheet" type="text/css" /> <div id="main"> <center> <object width="740" height="207" > <param name="movie" value="admin_menu.swf" /> <embed src="images/admin_menu.swf" width="960" height="170" /> </object> <h2>Admin | Tutorial</h2> <br /> <div class="about"> <div class="contactform"> <div id="li1"> <asp:Label ID="titleLabel" runat="server" Text="Title" CssClass="label" /> <asp:TextBox ID="titleText" …

Member Avatar
Member Avatar
+0 forum 11

Hi I'm trying to use the Microsoft.VisualBasic IRR function, but to no success. [code] double[] values = new double[73]; for (int j = 1; j <= 73; j++) { values[j] = C158_Calc; } B162_Calc = Financial.IRR(values, 0.1) * 12; [/code] I'm having trouble in this line: [code] B162_Calc = Financial.IRR(values, 0.1) * 12; [/code] I'm not sure how to call the values

Member Avatar
Member Avatar
+0 forum 9

I'm trying to insert a record from a DataGridView into a database, but I receive this error: [COLOR="red"]Parameterized Query '(@i1 int,@i2 varchar(50),@i3 varchar(50),@i4 varchar(50),@i5 var' expects parameter @i1, which was not supplied.[/COLOR] I have tested with a BreakPoint that c_id is not null, it does have a value. *Note c_id is only a link to another table, it is not the invoice tables id. [CODE] string reference = "INV" + Random(); string status = "0"; SqlConnection cnn = new SqlConnection(connectionString); string sqlInsert = "INSERT INTO invoice(c_id, date_added, customer, status, items, description, quantity, unit_value, total, notes, notes_internal, ref, payment_ref) values(@i1,@i2,@i3,@i4,@i5,@i6,@i7,@i8,@i9,@i10,@i11,@i12,@i13)"; SqlParameter[] …

Member Avatar
Member Avatar
+0 forum 7

Hi everyone, I am trying to populate a gridview. this is my table structure: Modules - M_ID, M_title (this is where the module info is stored) Module_course_link - MC_ID, M_ID, C_ID (this table links the Modules and Courses table) Courses - C_ID, C_title (this is where the course info is stored) this is where I get the C_ID <code>string C_ID = Request.QueryString["C_ID"]; (this works)</code> what I need help with is, to populate the gridview, at the moment I'm using this syntax, I want the MC_ID to be the DataKeyName of the gridview, at the moment only M_title AS Modules are …

Member Avatar
Member Avatar
+0 forum 3

Hi, I've got a door_order table which I export to excel, now I have to make it so that underneath each door_order the products are listed from door_product table, please not that this can be more than one product for that order. This is my code so far public DataTable GetData(SqlCommand cmd) { DataTable dt = new DataTable(); SqlConnection con = new SqlConnection(@"Data Source=;Initial Catalog=bargaindoors;Persist Security Info=True;User ID=;Password="); SqlDataAdapter sda = new SqlDataAdapter(); cmd.CommandType = CommandType.Text; cmd.Connection = con; try { con.Open(); sda.SelectCommand = cmd; sda.Fill(dt); return dt; } catch (Exception ex) { throw ex; } finally { con.Close(); sda.Dispose(); …

Member Avatar
+0 forum 0

hallo, I want to create a print preview for an invoice. What I'm having problems with is, most of the content in the print preview is pulled from a database and not the form, I am not sure how to implement this into the code, plus how would I change the font size, color, position... [CODE] private void preview_btn_Click(object sender, EventArgs e) { ThePrintDocument.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(PrintPage); string strText = "test" // HOW CAN I ADD FROM DB myStringReader = new System.IO.StringReader(strText); PrintPreviewDialog printPreviewDialog1 = new PrintPreviewDialog(); printPreviewDialog1.Width = 1100; printPreviewDialog1.Height = 900; printPreviewDialog1.Document = this.ThePrintDocument; printPreviewDialog1.ShowDialog(); } [/CODE]

Member Avatar
Member Avatar
+0 forum 2

I'm creating a Content Management System. Users must be able to delete content from a database. This does not delete or give an error message, it just does nothing. [code] protected void deleteBut_Click(object sender, EventArgs e) { string A_ID = Request.QueryString["A_ID"]; string sel = "DELETE FROM acomodation WHERE A_ID=" + A_ID; string s = "Provider=Microsoft.Jet.OLEDB.4.0; " + "Data Source=" + Server.MapPath("calendar.mdb"); OleDbConnection con = new OleDbConnection(s); con.Open(); OleDbCommand cmd = new OleDbCommand(sel, con); cmd.ExecuteNonQuery(); con.Close(); con.Dispose(); } [/code]

Member Avatar
Member Avatar
+0 forum 3

I've got a DropDown which I populate from a database. When an item is selected I want to redirect to another page with the selected id, but the problem is it passes "1" no matter what was selected. [code] protected void Page_Load(object sender, EventArgs e) { Populate(); } public void Populate() { OleDbConnection con = new OleDbConnection( "Provider=Microsoft.Jet.OLEDB.4.0; " + "Data Source=" + Server.MapPath("connect.mdb")); con.Open(); string strQuery = "SELECT A_ID, Title_eng FROM C_about"; OleDbCommand cmd = new OleDbCommand(strQuery, con); OleDbDataReader reader = cmd.ExecuteReader(); titleSelection.DataSource = reader; titleSelection.DataValueField = "A_ID"; titleSelection.DataTextField = "Title_eng"; titleSelection.DataBind(); con.Close(); con.Dispose(); } protected void titleSelection_SelectedIndexChanged(object sender, …

Member Avatar
Member Avatar
+0 forum 2

I got this code off a site, with a really nice layout and style, I've never worked with input field, so I'm stuck how can I save this to a database. I tried changing everything to a <asp:Label> and <asp:TextBox> but then I do not get the same layout. [code] <body> <div id="text"> <div class="body_resize"> <div class="about"> <h2>Registration</h2> <form method="post" id="contactform"> <ol> <li> <label for="firstName">Name</label> <input id="firstName" name="nameTextBox" class="text" /> </li> <li> <label for="country">Country</label> <input id="country" name="countryTextBox" class="text" /> </li> <li> <label for="email">E-Mail Address</label> <input id="email" name="emailTextBox" class="text" /> </li> <li> <label for="email">Username</label> <input id="user" name="usernameTextBox" class="text" /> </li> <li> …

Member Avatar
Member Avatar
-1 forum 6

Can someone please help me to create a circular reference I need to add a to b and b to a. I've been looking everywhere can this be accomplished with enum or structs? Please help me

Member Avatar
Member Avatar
+0 forum 11

Hi I'm coding in c# and I'm usiing the IIR function of Microsoft.VisualBasic. I need values for 6 years that's 72months [code] if (i <= 72) { values[i] += C158_Calc; } B162_Calc = Financial.IRR(ref values, 0.1) * 12; row9["Month1"] = String.Format("{0:#,###,###,###.##}", B162_Calc); [/code] this gives me this error: Arguments are not valid. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Arguments are not valid. but if I say up to 10months it works, more …

Member Avatar
+0 forum 0

Hi, I've got a DropDown list which is populated here. with the use of a break in the code there is a value of 4 for shippingInfo.ShippingID.ToString() [code] if (addressOK) //&& cardOK { int shippingRegionId = int.Parse(Profile.ShippingRegion); List<ShippingInfo> shippingInfoData = CommerceLibAccess.GetShippingInfo(shippingRegionId); foreach (ShippingInfo shippingInfo in shippingInfoData) { shippingSelection.Items.Add( new ListItem(shippingInfo.ShippingType, shippingInfo.ShippingID.ToString())); } shippingSelection.SelectedIndex = 0; } [/code] then when the checkout button is selected here: [code] protected void placeOrderButton_Click(object sender, EventArgs e) { // store the total amount decimal amount = ShoppingCartAccess.GetTotalAmount(); // get shippingId or default to 0 int shippingId = 0; int.TryParse(shippingSelection.SelectedValue, out shippingId); string shippingRegion = (HttpContext.Current.Profile …

Member Avatar
Member Avatar
+0 forum 4

Hi, I'm making a CMS, and I have a description TextBox which I would like to include html tags, to save to a database, but I get an error "A potentially dangerous Request.Form value was detected from the client (ctl00$adminPlaceHolder$grid$ctl02$descriptionTextBox="<b>Model No.:</b><br..."). "

Member Avatar
Member Avatar
+0 forum 8

I want to export evrything in a page to excel, it's just the graph that does not export. I used ChartControl graph which I downloaded. [code] protected void excel_Click(object sender, EventArgs e) { excel.Visible = false; Response.ContentType = "application/ms-excel"; Response.AddHeader("content-disposition", "attachment; filename=CashFlow.xls"); } [/code]

Member Avatar
+0 forum 0

Can someone please help me in creating an array, I've got a DataTable with 270months columns so I've used a forloop for that. My array has to be the same as C158_Calc but only for 73months. At the moment the array is returnig each element as 0. C158_Calc values are correct. [code] double[] values = new double[73]; for (int i = 1; i <= 240; i++) { double BW154_Calc = 0.0; if (i == 72) BW154_Calc = (C152_Calc * 12 / G169_In) * 100; if (i == 240) BW154_Calc = (C152_Calc * 12 / G170_In) * 100; num3 += BW154_Calc; …

Member Avatar
Member Avatar
+0 forum 1

Hallo, can someone please help. I've got 2 calculations, and they need each other for the calculation, I've declared both global, because H44_Out is first 0 is used as H42_Out and therefore giving a wrong value to H42_Out, is their a way to do this? [code] H44_Out = (G123_Calc + H42_Out + tenantingCosts + developmentCosts + authority + propertyValue + H37_Out + E93_Calc + E91_Calc + estimateCost) * 0.004; H42_Out = (estimateCost + E91_Calc + E93_Calc + H37_Out + propertyValue + authority + developmentCosts + tenantingCosts + H4 [/code]

Member Avatar
Member Avatar
+0 forum 2

The DataTable's Rows show likw this, how do I fix it. [B]Month1[/B] [B]Month2[/B] [B]Month3[/B] 1 2 3 1 2 3 1 2 3 [code] double C146_Calc = 0.0; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { // create the table DataSet ds = GetTable(); outputView.DataSource = ds; outputView.DataBind(); } } public DataSet GetTable() { double H30_Out = -63268973; double H91_Out = 5640000; double H94_Out = -846000; C146_Calc = H91_Out / 12; double C148_Calc = H94_Out / 12; double G158_In = 8; double C150_Out = C146_Calc + C148_Calc; DataTable dt = new DataTable("Details"); DataSet ds = new DataSet(); ds.Tables.Add(dt); …

Member Avatar
Member Avatar
+0 forum 9

When values are entered into 2 TextBox's(textbox1 & textbox2) they are multiplied with one another and the answer is displayd in a Label(label1), I need to add all the labels and display it in another label, this has to be don without buttons. When the TextBox's change this function is called. [code] function Calculate(textbox1, textbox2, label1) { var txt1 = 0; var txt2 = 0; txt1 = document.getElementById(textbox1).value; if (txt1 == "") txt1 = 0; txt2 = document.getElementById(textbox2).value; if (txt2 == "") txt2 = 0; var cost = txt1 * txt2; document.getElementById(label1).innerHTML = cost; } [/code]

Member Avatar
Member Avatar
+0 forum 12

Hi, I've got a input sheet where start and end dates are saved to a access database, I do have the access database dates field as Date/Time with a short date format. On my output page the start date's month and day are swapped but only if the actual day is between(1-12) else its fine. I've checked the database it does save the date as yyyy/mm/dd. But I've got the same code for start and end date, but only startDate has this problem. I don't where this error may occure and I do have so much code, so could someone …

Member Avatar
Member Avatar
+0 forum 4

Hello, I get this error: System.IndexOutOfRangeException: 2000 I've got a table this table in excel: Month 2000 2001 2002 2003 1 180.4 194.3 209.0 236.4 2 181.1 195.2 212.2 237.9 3 182.4 196.3 213.1 238.7 4 184.1 197.4 216.5 240.1 5 185.4 198.6 219.4 240.2 6 186.1 199.0 220.7 240.7 (up to 2013) 7 187.7 200.1 224.5 241.1 8 189.2 200.5 227.0 241.0 9 189.8 201.0 228.2 240.8 10 190.6 201.9 230.5 240.8 11 191.6 203.0 231.9 240.5 12 192.2 203.9 232.8 240.4 [code] private void Database() { string strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|calculator2.mdb"; DateTime e59 = tenderDate; DateTime e61 = …

Member Avatar
Member Avatar
+0 forum 4

Hi I've got the JavaScript that calculates the amount of two TextBox's(rate_## and area_##) and displayes it in a label(amount_##), what I'm trying to do is to add up all of the amounts and display it in another label(estimatedCost), I've tried this with the first function but the estimatedCost label displays NaN. [code] <script type="text/javascript"> var estimatedCost; function Amount01() { var val1 = document.getElementById('area_01').value; var val2 = document.getElementById('rate_01').value; if (val1 != '' && val2 != '') estimatedCost += val1 * val2; document.getElementById('amount_01').innerHTML = val1 * val2; document.getElementById('estimateCost').innerHTML = estimatedCost; } function Amount02() { var val1 = document.getElementById('area_02').value; var val2 = …

Member Avatar
Member Avatar
+0 forum 9

Hi I'm trying to pass data from one page to another, but it does not display anything, Page 1: [code] protected void submit_Click(object sender, EventArgs e) { addData(); Session["value"] = space_01.Text; } public void addData() { string tenderDate = start_txt.Text; string cost = totalCost.Text; string companyName = name_txt.Text; string scon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|calculator2.mdb"; string str = "INSERT INTO form_input(companyName, tenderDate, cost) VALUES(companyName, tenderDate, cost)"; string id = "Select @@Identity"; int f_id; using (OleDbConnection con = new OleDbConnection(scon)) { using (OleDbCommand cmd = new OleDbCommand(str, con)) { cmd.CommandType = CommandType.Text; cmd.Parameters.AddWithValue("companyName", companyName); cmd.Parameters.AddWithValue("tenderDate", tenderDate); cmd.Parameters.AddWithValue("cost", cost); con.Open(); cmd.ExecuteNonQuery(); cmd.CommandText = id; …

Member Avatar
Member Avatar
+0 forum 1

[code] protected override void OnInit(EventArgs e) { this.currency_txt.TextChanged += new EventHandler(currency_txt_TextChanged); base.OnInit(e); } protected void currency_txt_TextChanged(object sender, EventArgs e) { rateSymbol.Text = currency_txt.Text; amountSymbol.Text = currency_txt.Text; } [/code] i'm trying to write a textbox text to a label, the above code doesn't change anything or give any errors. My textbox and label are on different tables on the same page.

Member Avatar
Member Avatar
+0 forum 8

I've got this code that creates a Table and a graph, the values have to be int for the graph. But in the table I want t display the values as... 1,000,000 How can I do this?? [code] public partial class output : System.Web.UI.Page { int max = 0; int current = 0; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { // create the table DataSet ds = GetGraph(); outputView.DataSource = ds; outputView.DataBind(); // create the graph SmoothLineChart chart1 = new SmoothLineChart(); chart1.Line.Color = Color.Blue; chart1.Fill.Color = Color.Blue; chart1.Legend = "Construction Cash Flow"; SmoothLineChart chart2 = new SmoothLineChart(); …

Member Avatar
Member Avatar
-1 forum 3

I've got a DataSet that shows a table through Gridview, and the same DataSet also creates a graph. But my problem is that e.g. Date format is different for both, so I was wondering can you change format in a GridView populated by a DataSet? For the graph date has to be: April 2010 For the table(gridview) date has to be: 2010/04/31 [code] protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DataSet ds = GetTable(); outputView.DataSource = ds; outputView.DataBind(); } } public DataSet GetTable() { string f_id = Request.QueryString["f_id"]; string strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|calculator.mdb"; OleDbConnection con = new …

Member Avatar
Member Avatar
+0 forum 1

[code] protected void currency_txt_TextChanged(object sender, EventArgs e) { amountSymbol.Text = currency_txt.Text; } [/code] I'm trying to change a label according to a TextBox, without a button that has to be pressed?

Member Avatar
Member Avatar
+0 forum 3

I'm trying to make a graph with WebChart Control which I downloaded, But i receive this error. System.Application:Error while saving the file: ---> System.OverflowException: Overflow error. at WebChart.ChartEngine.GenerateBitmap() at WebChart.ChartEngine.SaveToFile(String filename, ImageFormat format) --- End of inner exception stack trace --- at WebChart.ChartEngine.SaveToFile(String filename, ImageFormat format)

Member Avatar
Member Avatar
+0 forum 1

has anyone worked with Open Flash Chart, I'm having trouble using it.

Member Avatar
Member Avatar
+0 forum 1

Does anyone know of an easy way to make a line graph from a datatable, I've looked everywhere, and downloaded a bunch of code which doesn't make sense to me. Please it's urgent!!!

Member Avatar
Member Avatar
+0 forum 1

[code] public List<DateTime> GetDates(DateTime startDate, DateTime endDate, int valuationDay) { TimeSpan span; span = endDate - startDate; List<DateTime> result = new List<DateTime>(); DateTime dateToParse = DateTime.MinValue + span; int yearMonths = 0; if (dateToParse.Year > 0) { yearMonths = (dateToParse.Year - 1) * 12; } int monthCount = (yearMonths + dateToParse.Month) - 1; for (int i = 0; i <monthCount; i++) { DateTime currDate = endDate.AddMonths(-(monthCount - i)); int lastDayOfMonth = DateTime.DaysInMonth(currDate.Year, currDate.Month); currDate = new DateTime(currDate.Year, currDate.Month, lastDayOfMonth); if (currDate.Day <= valuationDay) { result.Add(currDate); } else { currDate = new DateTime(currDate.Year, currDate.Month, valuationDay); result.Add(currDate); } } return result; } …

Member Avatar
Member Avatar
+0 forum 2

The End.