ASP.Net Bound Column Error
I am currently working my way through a tutorial from my asp.net book and am slowly getting an understanding how this type of coding works. However, I have come to a standstill with the code below. Code:
View RepliesI am currently working my way through a tutorial from my asp.net book and am slowly getting an understanding how this type of coding works. However, I have come to a standstill with the code below. Code:
View RepliesI am altering an existing asp page,just by adding a new check box, I am going through the code making sure I cover every aspect of the change (there are many check boxes) and situation is exactly the same.'
When I load the page this is the error I get and I don't know why is this appearing,why wouldn't it like a new column, it has been added in the table on the server.
This occurs in my select statement.
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'Invoicing'.
Has anybody come across that?
got the following sql
Dim varEmail = Request.Form("email")
Dim sqlQuery
sqlQuery = "SELECT * FROM users_tbl WHERE email ='+ varEmail+'"
However this does not seem to work as expected..what am i doing wrong?
I tried
sqlQuery = "SELECT * FROM users_tbl WHERE email =" + varEmail
But this doesnt seem to work either..when i try recieving records from the database it just says unknown column etc error
I'm getting this error trying to INSERT information into a database. Its saying that the Invalid column name is TicketNum. I have looked at the field name for the database and it is the same.
cnOperations.Execute("INSERT INTO DailyLog (Bancnum, Problem, Solution, TicketNum, CurDate, Operator, InTime) VALUES ('" & Bancnum & "', '" & Problem & "', '" & Solution & "', '" & Tnum & "', '" & setDate & "', '" & User & "', '" & time() & "')")
reading the article about protection against sql injections faced that author recommends to
"use bound parameters (the PREPARE statement)"
examples are given in perl and java. Tried to find something for ASP, but did not find anything neither in web, nor w3schools, nor here. Could someone explain what is this and how to use it to prevent SQL injection.
I have a 3 page set that searches a database for users, displays the user information in a form and updates the data in the database. The first 2 pages work fine, the third page doesn't. What is annoying is that these pages are a copy of another set of pages that edit news articles (basically the same thing) and they work perfectly.
This is ASP with SQL and VB Script.
Quote: Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value '6, 6' to a column of data type int.
/d1intranet/useredited.asp, line 72
So this message is saying that it is unable to UPDATE the field 'UserName' (which has data type INT) with the variable in the SQL code which is default as VARCHAR. Here is line 72: Code:
i have a variable cup and works like this for each item in request.querystring
if cup <>"" then
cup = cup + 1
next
how do i get the maximum number in cup ? do i use ubound ?
How can I make such a bold statement? Two words: Buffer Overflow.
In the very first class I took in programming (those many years ago), we were berated class after class about proper bounds checking to prevent buffer overflows. What this means in simple terms is that every time my program asked the user for input, it had better check to make sure the input fit in the place I reserved for it. If I asked for a ''Y/N'' and I got a ''yes'' or a ''no'', those extra characters had to go somewhere and I had better be prepared for them.
I have an ASP that retrieves data from a SQL server database. Most of the columns are varchar. Some of the fields are meant to populate input fields. Here is my code.
<input type = "text" name="comments" value =<%= rstSimple.Fields("comments")%>
the value is returned, but only the 1st word. It seems it cannot process a space, but when I add the following to a table;
<td><%= rstSimple.Fields("defects").Value %></td>
the whole value is returned. Is there a limitation to the input field and how can I change it?
I've got a page with a DetailsView. It uses a SqlDataSource which itself
uses stored procedures for Select and Update.
I don't want the user to see some of the columns, but if I don't bind them
(or if I do bind them but set Visible=False), when the Update procedure is
called, the parameters corresponding to the columns that weren't bound to the
DetailsView are all null.
This can't be an uncommon scenario, so I guess I have missed something. Any
ideas?
I want MS Access 2000 database column of table 1 = column of table 2. This is what I was doing: Code:
View Replies View RelatedI have a csv file that I'd like to be able to add a column to. Specifically, I want to take the first 6 chars of the filename and add it to each row as a new column. e.g.
Code:
whatever.csv 'before
1,2,3,4
whatever.csv 'after
1,2,3,4,whatev
Ok let me explain what I am trying to do as easily as I can. I have a table in my access database that I am connecting to. I select a specific id number using my SQL statement. Now what I am trying to do is scroll through that records row and get the column name of that column along with the value of that cell. I hope that isn't to confusing. Now I'm not sure whether this would be done using ASP or done in my SQL statement. Code:
View Replies View RelatedHow do you get the description of fields in an Access database? I really need this and can't find it anywhere....
It would also help if someone showed me how to get the datatype and other info (like if it's a Yes/no or True/False field).
What is the resource/doc for this so I know where to look before asking from now on?
Ok i'm self taught with regards to ASP so not great etc, so sorry if this is a really basic question..
On the last line here i'm trying to some how get it to call the last ID entry...
ImageID = Request("ID")
If (Len(ImageID) = 0) then ImageID = "1"
If Not IsNumeric(ImageID) Then ImageID = "1"
If ImageID = "0" then ImageID = "1"
If ImageID>3 then ImageID = max(Len(ImageID))
This is basically for some max min links for a online comic here's what it links to
<a href="default.asp?id=<%=ImageID-1%>">< Backwards</a> -
<a href="default.asp?id=<%=ImageID+1%>">Forward ></a> -
Code:
Can someone please explain to me why the hyperlinked column headings will sort in Firefox and IE 7 but not in IE6. Code:
View Replies View RelatedI need to set up an HTML table or the like, with 4 columns.
Each column needs to have a header with a FRIDAY (dd/mm/yy) date.
i.e. this weeks Fridays date is 16th Feb, the following is 23rd Feb
etc.
So, I need column 1 to be headed 16th Feb, col 2 to show 23rd Feb etc.
As this week passes, the dates need to move up 1 week, so that next
week, col 1 will display 23rd Feb and so on.
These headers need to change according to the date.
Please can you advise how I best achieve this ?
we have a requirement to freeze the column and row column heading... so that when the user scrolls to the right the first two columns ( I refer them as "row headings") will stay and the remaining columns scroll left and when the user scrolls to the bottom the first row stays ("column headings")and the remaining rows will scroll up.. This can be easily accomplished in EXCEL by freezing the itersecting cell... How can the same be accomplished using HTML tables /ASP code.... Is there any Active X control available that can be used to accomplish the same?Our technical env is ASP and Oracle DB
View Replies View RelatedPretty basic but I cannot figure it out.
Column:
FULLNAME (lname, fname)
Needs to be
FNAME
LNAME
Should split at the comman.I already have all the columns created; just
need to SQL command to make it happen.
I am trying to access a table in a SQL server using ADO in ASP. It works fine in the rest of the site. Here is the code:
View Replies View RelatedIf I have several fields:
a | b | c | d | e
and the original SQL = SQL & " ORDER BY a ASC ".
I want to place links to b, c, d, e to make the table of results to show by ascending order of b (or , c, d, e).
do I need to place an "if/ end if" in the sql or do I put some statement in the paging?
example
a (ORDER BY a ASC)| b | c | d | e
1 | 3 | z
2 | 2 | y
3 | 1 | x
4 | 5 | w
5 | 4 | v
to
a | b (ORDER BY b ASC)| c | d | e
3 | 1 | x
2 | 2 | y
1 | 3 | z
5 | 4 | v
4 | 5 | w
I have a SQL query that produces a table which displays account numbers and the amount owed on those accounts.
the page that displays that table is written with ASP. Does anyone know how can I highlight the rows in the table where account numbers have more than 7500 dollars in amount owed? Code:
im reading from multiple databases, and one restraint is that i must know the amount of columns and the names of the columns before i can display info from the database.my question: can i somehow GRAB or READ this information from each database and then just adapt my Display accordingly
View Replies View RelatedI have an asp page which the user enters a time(e.g. 12:21). I need to insert this time into a SQL Server DB, which has a smalldatetime column.
I have tried everything I can think of (such as CDate, TimeValue, FormatDateTime etc) to convert the time string, into a valid time. However, the insert always try to insert a datetime datatype (e.g. 12/12/1899 12:21:00).
I am trying to process the insert through ado, eg:
objRS.AddNew
objRS("Field1") = strText
objRS("DateField") = dteValue
objRS.Update
I use this code to dynamically create a column in a table...
strSQL = "CREATE TABLE (FirstName TEXT(30), LastName TEXT(20));"
conn.execute(strSQL)
This will create two text columns. How can I create some YES/NO columns
instead of TEXT columns?
Is there a way to have a piece of repeating information display in multiple columns like a phone book? I need to display a list of contract numbers which will link to the actual contract.
There is no other information to display and it would be better if I could display 3 or 4 columns on the page like a phone book. Hope that makes sense. I am using Dreamweaver and it's and Access db if that helps.
I use this code to create a table dynamically.
strSQL = "CREATE TABLE (FirstName TEXT(30), LastName TEXT(20));"
conn.execute(strSQL)
This will create two text columns. How can I create some YES/NO columns instead of TEXT columns?
Is it possible to get a db's column names not the data inside the columns just the columns names.
View Replies View RelatedI've searched high and low in this forum for an answer to this one. maybe someone knows where it's at.
Let's say I have a page that is displaying fields from the database. There is a column of numbers, that at the bottom of the page I would like it to display the total of those numbers displayed. Is there an easy way to make this happen?
I want to save the details of phases. On selecting a phase, there are 3 columns, task ,start date, end date in a row. Next to it, a button'Add task' is displayed. on clicking this, another row appears below. When i click submit, the data is saved if the following condition is truw: The end date should not be less than start date. how do i retieve the data of all the rows.
View Replies View RelatedHow do I print the name of all columns in a table?
View Replies View Relatedi need some quick help from who has dealt with this before. I am trying to add a column to the db using form input for the column name.
I can add it as any datatype however i need it to be a Yes/No checkbox column. What is the script required to achieve this?
heres my code:
SQLadd="ALTER TABLE Models ADD COLUMN `" &namef& "` BIT"
conn.Execute(SQLadd)
I read somewhere i have to use BIT but i only get value 0 and not an actual check box.
i want to extract out certain column from my table . can i do it using the checkbox . eg. when i got ten check box then when i select 4 of it . the selected 4 column will appear in my next page . can i do it this way ? or is there any other easier way ?
View Replies View Related