Dataset Data To Variable Trouble
i need to use the returned value from a database in my code. it is not to be displayed on a aspx page. I can connect to a database and return the one value i want using SQL SELECT.....FROM.....WHERE...... condition. this is returned as a dataset.
Is there anyway i can return this value from the database as its real value as there is only 1 record? If not how can i retrieve this 1 value and use it in my code? Do i need to loop through the dataset and return it as a string? I want to retrieve 4 values from 4 difference database tables and them up in my code and then return the total value to a different database table.
View Replies
ADVERTISEMENT
I have a web interface where the user types in ID's one at a time. After an
ID is typed in, a button is clicked and the button click event has code that
does a query and returns a data reader and then appends the data to a
dataset that is built in the Page_Load code in the if(!isPostBack) block.
When I try to add a row in the button click event code I get an error saying
that "Object reference not set to an instance of an object". I'm saving the
dataset in a Session object and then restoring it in the else clause of the
if(!isPostBack) block. I've pasted code below, please help. I'm relatively
new at asp.net development but have lots of asp and ado experience. Code:
View Replies
View Related
I am having trouble with a database quary involving a variable.
The following code does not work.
Set objConn1 = Server.CreateObject("ADODB.Connection")
objConn1.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/fpdb/Training2004.mdb")
Set Question = objConn1.Execute("SELECT * FROM '" & Module & "' ORDER BY ID")
The variable Module causes errors. However, if ireplace that line with the bellow line the code works.
Set Question = objConn1.Execute("SELECT * FROM Safty ORDER BY ID")
For some reasion i have to type in Safty, i can't enter it with the Module variable even though it contains Safty as its value.
Any ideas how i could get the quary to work with the Module variable becasue i don't always want to access the Safty database?
View Replies
View Related
I have a drop down list which pulls Names from a column called 'Name' from an SQL Server view.
In this view is another column called 'ref' and each person has their own unique ref no.
I have linked a drop down list to the Name column (so user can pick name from the list) but now after selecting a particular name, I want my page to also display the corresponding ref for that particular name underneath.
The ref can be displayed just as text on the page.
View Replies
View Related
is there any way of passing a javascript variable over to a asp variable so
i can write it to my database.
View Replies
View Related
I have a method that uses Microsofts Data Block to get me a value from the database. This returns a DataSet. I use this kind of data as string a lot using the following:
ds.Tables[0].Rows[0].ItemArray.ToString()
The problem is: I do not want a string now. I need a int, because the value is a int which I have to increase with one and then return back to a tring again to put in a disabled textbox.
I just need to know how to get from a DataSet to an int or from a String to an int.
View Replies
View Related
I am pulling 40 records from a MS Access database, and displaying them in an .asp page..
The majority of times, there are no records to display in the last 10-15 records, so they show up as a blank space on my web page, pushing the rest of the content further down.Is there any way that I can elliminate this?
View Replies
View Related
I have a DataGrid which has checkbox columns. The data source is a run-time created data set that I store in a session so I can rebind it during postbacks. I don't have a database or xml file, etc.if it's possible to edit a dataset directly? So when I click on a checkbox it will change the value in the dataset and store it back into session?
If this is not possible how can I use arrays or vectors to temporary store my checkbox statuses? I guess it's not possible to have one DataGrid have more than one datasource
View Replies
View Related
Am putting a web front end over an existing SQL application, creatind a ado recordset which is to be displayed in a table on the screen, however when the page runs the recordset returns correctly however only the first two columns have data in, the remaining columns in the table are blank.
Have to use both an sqlview and base sql select statements for the recordsource both the same result. I know it is not a permission problem as I can run the query in sql with the same credentials ok.
View Replies
View Related
I have a DataGrid which has checkbox columns. The data source is a run-time created data set that I store in a session so I can rebind it during postbacks. I don't have a database or xml file, etc.
I am wondering if it's possible to edit a dataset directly? So when I click on a checkbox it will change the value in the dataset and store it back into session? If this is not possible how can I use arrays or vectors to temporary store my checkbox statuses? I guess it's not possible to have one DataGrid have more than one datasource.
View Replies
View Related
i have a dataset that has say 3 cols (id,name,marks). i want to calculate sum of all marks by traversing all rows in dataset.
like ,
sum = 0;
val = Ds.Tables[0].Rows.Count;
for (int i = 0 ; i< val; i++)
{
sum = sum + Ds.Tables[0].Rows[i].ItemArray["marks"].ToString()
}
but i am getting error in underlined position .
View Replies
View Related
I have two tables: one table forms the header columns and the other table is in an iframe returning the results of an sql query. The query works fien and returns the appropriate data but the rendering of the columns in the top table does notmatch those in the iframe table, even though they are supposed to be the same width!!
The iframe table has a scroll bar and the data returned sizes each column cell
dependant on the amount of data returned regardless if i stipulate a set width!!
As you can imagine this is visually poor as the table columns are not correct for both tables!!
View Replies
View Related
Is there a way to print a variable's data type - like int, string, dbl?
View Replies
View Related
-Dim cmd As OleDbCommand
-cmd = New OleDbCommand("select * from qmsstats where firstname='jason'",
OleDbConnection1)
-OleDbDataAdapter2.SelectCommand = cmd
-DataGrid1.Visible = True
-OleDbDataAdapter2.Fill(DsQmsStats1)
-DataGrid1.DataBind()
In the above example I need to change 'jason' to a variable. I need the variable to be pulled from a textbox. IE: txtusername.text. Please advise how I can get the value from txtusername.text in place of 'jason'.
View Replies
View Related
I get a "data type mismatch error". I assume it is because this is a number, but I don't know what to change.
<%
dim cnStr
dim rcSet
dim frmSSN
dim sqlStr
'store form input into variables
frmSSN = Request.Form("SSN")
'create connection and recordset objects
Set cnStr = Server.CreateObject("ADODB.Connection")
Set rcSet = Server.CreateObject("ADODB.Recordset")
' defining database connection (connectionstring2.inc)
cnStr.ConnectionString = path
cnStr.Provider = provider
cnStr.open
%>
<%
SQL_query = "SELECT * FROM Orders WHERE Driver = '" & frmSSN & "'"
Set RS = cnStr.Execute(SQL_query)
WHILE NOT RS.EOF
%>
View Replies
View Related
I have a page that calls itself using a form. The form has two select elements. In the sql statement I am attempting to match the values of the select element to populate a recordset.
The two fields in teh Access db are of type Text and of type Integer. What baffles me is that one sql statement works fine and the other returns nothing. I am having the issue matching on the bedrooms.
In the first statement I took out all other doo-doo and just matched bedrooms = request("bedrooms"). On the other one I used p.bedrooms but it keeps turning up empty. Code:
View Replies
View Related
I was wondering If there is any way to grab just the viewable text of a webpage
using xml. Not the html, just what the user can see.
View Replies
View Related
I am having trouble with installing IIS, I tried to do it in my control panel, but it wants the disk, I don't have the disk because my computer came with Windows XP Pro 2002 Service pack 2.
so I went to the microsoft website and downloaded the free download of IIS6. Then when I go to my control panel and Administrative tools it is in there and when I click on it, there is no computer name available.
View Replies
View Related
I have a sign-in box that is an IFrame, with a form target of "_top", and
the current (parent) page URL as a hidden field.
If sign-in in successful, there is a response.redirect to the page URL,
having set the session variable LoggedInOK=true.
However, if the sign in is not OK, I want the IFrame to be the target, (i.e.
_self, not _top) to display the error.
Is there a way for ASP to control whether it redirects to _top or _self, as
setting the form target in the Login page requires "pre-knowledge" of
whether it will be successful.
View Replies
View Related
I am moving a ASP website to a new Window 2003 server with
IIS 6, but an error occur for the metadata declaration in
my global.asa
<!--METADATA TYPE="TypeLib" NAME="Microsoft Scripting
Runtime" UUID="{420B2830-E718-11CF-893D-00A0C9054228}"
VERSION="1.0"-->
the error message is
Active Server Pages error 'ASP 0223'
TypeLib Not Found
/LM/W3SVC/1/Root/myweb/global.asa, line 4
METADATA tag contains a Type Library specification that
does not match any Registry entry.
View Replies
View Related
I'm writing an Online registration system for my friends new business.
I'm trying to incorporate checkboxes so when a person checks on 3 or 4 checkboxes and hits the Submit button I can
pass the information of what they checked_on to a new page.
When I get to the new page I would like to update a database, based on what they checked_on on the previous page.
I'm not sure how to do this.
I'm not sure how to pass the information.
View Replies
View Related
Ive got a script here that searches using info from querystrings. it's just a snippet from the other lot. Code:
View Replies
View Related
using PWS on test machine (NT4 workstation SP6) and everything was fine but cpshost.dll was used in the website we're maintaining, so I idiotically installed it from a Visual J++ disc. now the website works fine but when i navigate to 127.0.0.1 nothings happens. I've checked directory browsing is enabled but still nothing happens!
I'm aware that cpshost.dll was never meant to be used on NT workstations but as I said before the upload functionality works fine, it just seems to have screwed the directory browsing up - and also the code document.referrer equals nothing.
View Replies
View Related
I am primarily a front-end designer and not familiar with ASP beyond
breaking up pages into include files. Recently, one of my freelance
clients wanted to display an RSS feed from his blog on his site. I did
some research and found the rss2html.asp script. I chose this over a
javascript solution because those scripts apparently don't affect
search engine rankings.
I implemented the script and it was running fine until about a month
ago, when the site and sometimes the server running it started to
crash. The ISP and the blog company the RSS feed originates from blame
the script. Bytescout, who wrote the script, says that it's probably
the feed that's causing the problem. The RDF version of the feed
validates as RSS, but the ATOM one has specs that are too new for the
validator to parse correctly. Code:
View Replies
View Related
I keep having trouble connecting to my database I am running windows xp pro and Access 2000
Error Type:
Provider (0x80004005)
Unspecified error
/test.asp, line 60
It keeps bringing up the above error message sometimes it works fine then other times it dosen't has anyone had any similar problems.
View Replies
View Related
i'm working on access db the problem is when i enter date in d/m/y format it wrote db m/d/y format but this happens only with small numbers i.e if date 04/09/2002 it become 09/04/2002 in db but if it is 24/09/2002 there is no problem.
View Replies
View Related
I've narrowed down my error to one particular function. It looks as if the function may not be receiving the variable that is passed to it.
The error message is:
error '80020009'
results.asp, line 21
Line 21 is: Code:
View Replies
View Related
I'm having some trouble parsing an XML document I'm getting from my company's bank in response to a XML document I'm sending. Both docs are transferring fine, and in fact if the transaction in the document I send is accepted (valid credit card), everything parses perfectly.
The prob is when the transaction is not accepted by the bank server (invalid credit card), and the document that's returned to me has different tags. Code:
View Replies
View Related
I am having trouble with someone else's code that worked when it was used last, but now it's not. I am new to ASP programming so I not too sure what's happening. Code:
View Replies
View Related
I have started session("visitorID") in global.asa in order
to keep track of how many users are on our site at any
given time, trouble is I can't seem to call the session
while on another page.
As I am relatively new to asp I'll post both the setting
of the session and the call to it on the other page below Code:
View Replies
View Related
I am attempting to pull a value from my database and insert it into an ahref tag.
However I keep getting the following error..
Microsoft VBScript runtime error '800a01a8'
Object required: ''
Below is the code I am trying to make work..
<th width="25%" height="34" scope="col"><div align="center"><a href="cat_detail.asp?<%=(rsLastCatalogUrl.Fields.Item("txtCatalogUrl").Value)%>"><img src="../../../images/layout/buttons/button_backtocatalog_off.gif" width="100" height="30" border="0" /></a></div></th>
This is the SQL statement I am executing to pull the field, which is meant to be the last record inserted into the shopping cart by a particular individual. Code:
View Replies
View Related
I am having trouble with my file uploader. I do not program a lot of .asp and its a bit confusing. As well, I just took over the development on this webpage so the code is not my own.
The file uploader worked before but now that I have the webpage put to a test site it doesn't. Would this be a reason why I cannot upload? i am also having trouble accessing the database, which makes it even harder for me to see whats hapening to the file.
When I upload it says that it uploaded successfully but when I see the webpage the photo isn't there. Would you like to see the code for the uploader?
View Replies
View Related
I have this list of records (from an Access DB) and would like to use check boxes to delete 1 or many records. I think there is something wrong with the SQL though, cause the records are not deleting when the form is submited. Code:
View Replies
View Related