Jump to content
Xtreme .Net Talk

turonah

Members
  • Posts

    6
  • Joined

  • Last visited

Personal Information

  • .NET Preferred Language
    VB.NET, C#

turonah's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Alright - here's the deal: I'm trying to display information in a table on the page, but I'm not sure how to go about doing it. Basically, I've got to give the item #, the quantity, the cost, a markup percentage, and the resulting price. First off, there can be multiple quantities per item (to see the difference in creating one item as opposed to five). The cost is calculated at run-time, based on these quantities (it is then stored later in a database). The markup is defaulted at zero, but this has to be a textbox so that it's editable (the web form is meant only for the sales reps). So, I tried creating a table to display this by hand - headers, textboxes, style, the whole gambit ... the only problem is that when it comes back to the page, all the rows in the table are gone! (The table is set to runat="server", btw) Is there a way to do this with a repeater or datagrid by any chance? The faster the reply, the better ^_^ Reuben
  2. Joe Mamma, you hit the nail right on the head ... I had no idea that Min and Max were reserved SQL keywords (oops), especially since the names worked fine with ASP. Guess I'll have to change those field names :P Thanks very much!
  3. Alright, I've got a table in Access that will let me update anything ... except for two fields, "Min" and "Max" ... here's the sql query as I define it in VB.Net: (ASPX pages, btw) sqlQuery = "INSERT INTO ProcessPricing ( MaterialCode, Process, Min, Max, CostPerPound, RateMeasurement, RateAmount, MinimumCharge ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? );" I then define the parameters, etc. When I hit ExecuteNonQuery(), however, the application comes back saying that there's a syntax error in my INSERT INTO statement. I had the same problem when using UPDATE (minus the materialCode and Process fields), so I figured I could work around it by creating a new record (wrong!). I know it's the "Min" and "Max" fields through trial and error ... I basically tried updating each field separately until I hit the error again. The problem is, these two fields are the Double data type in the database, and I can't tell what's causing the problem ... especially since RateMeasurement is in the same table, of the same data type, the whole bit! Any ideas of what I might be overlooking? Thanks in advance, Turonah
  4. If I remember right, I've had this problem before ... First off, instead of "SELECT * FROM ..." try "SELECT TableName.* FROM ..." If that doesn't help, try putting brackets ( '(' and ')' ) around your WHERE criteria ... Hope this helps ...
  5. Nevermind - I found a way around it. Instead of having "SET ? = @@Identity" inside the SQL statement in the OleDbCommand.CommandText string, I removed the "ID" parameter completely and just executed the INSERT sql command by itself. Then, this code was added: dbCommand.CommandText = "SELECT @@Identity" id = CInt(dbCommand.ExecuteScalar()) This returned the last used number in the autonumber field. Thanks for your help (or lack thereof) anyways. Turonah
  6. Ok, here's the deal: I'm trying to add a record to a table in access using ADO.Net (from ASP), which, in itself is no problem. However, I need the autonumber field (the primary key) which I can't get until the data is finished being updated. Here's what I'm following: clickity The only problem is that it doesn't seem to like the "SET ? = @@Identity" in the sql statement or the dbCommand.Parameters("ID").Direction = ParameterDirection.Output With the ParameterDirection code, I get the message "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done." If I take that out, it complains about the missing ";" from my sql statement until I take out the "SET ?= @@Identity" statement. And yes, I've tried putting the ";" at the end of the statement, but it still complains. When I take out both of them, it inserts the data with no difficulty at all. Any ideas what's going on? Thanks In Advance, Turonah
×
×
  • Create New...