What is the difference between Server.Transfer and
Response.Redirect? Why would you choose one over the other?
Answer Posted / xy
Set exCon = Server.CreateObject( "ADODB.Connection" )
Set dbCon = Server.CreateObject
( "ADODB.Connection" )
'open connection to excel
'had to use the JET driver since some of
the ODBC functionality didnt work
exCon.ConnectionTimeout = 30
' exCon.open "Driver={Microsoft Excel Driver
(*.xls)};Dbq=" & Filepath & ";UID=admin;TypeGuessRows=0;"
exCon.open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & Filepath & ";Extended Properties=""Excel
8.0;IMEX=1;ImportMixedTypes=Text;TypeGuessRows=0"""
exCon.CommandTimeout = 90
'open connection to DB
openDBConnection(dbCon)
set rs=exCon.OpenSchema(20)
strPageName = rs(2)
'ADO replaces a ' with a '' by default. we
need to undo this change during the import.
if instr(strPageName, "''") > 0 then
response.write "The name of the
Spreadsheet tab cannot have a comma. "
response.write "The current name
["& replace(strPageName,"''","'") &"] must be corrected
before it can be uploaded.<BR>"
response.End()
end if
response.write "Page <B>" & strPagename
& "</B> was imported"
rs.close
set rs=nothing
Set RS = Server.CreateObject
("ADODB.Recordset")
RS.ActiveConnection = exCon
RS.CursorType =
1
RS.LockType =
1
RS.Source = "SELECT * FROM [" &
strPageName & "] where siteno is not null and projcode = '"
& strProjCode & "'"
RS.Open
if not rs.eof then
arrData = rs.getrows()
else
response.redirect "/error.asp?msg=Template Projcode
Mismatch ! (" & Request.ServerVariables("URL") & ")"
response.end
end if
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Can you dynamically assign a Master Page?
What is a session http?
How would you turn off cookies on a page of a website?
if i wanna deploy my asp.net project to the production server and situation is that i m still not compiled my project i have as-is on my development side now on production server we dont have a visual studio now what kind of settings i need to be to do in webconfig /machine.config file to deploy my project and in iis too....
Explain culture and uiculture values.
How would you implement inheritance using c#?
Explain what the contents of cookie?
Can you nest updatepanel within each other?
What is difference between cookies and cache?
Explain file-based dependency and key-based dependency.
What is ASLM?
What are the merits and demerits of viewstate?
how to debug web services on consumer side?
What are the asp.net 2.0 features?
how to implement some securty aspect in our application i.e 1.cookie poisioning. 2.data encryption. 3.forcefull browsing 4.sql/code injection 5.securing web app by using web services ........my question is how to implement these thing in our application is this done by hard coding or by help of some tool