|
Yes
---------------------------------------------------
|
|
|
|
|
well i have tested this code it really works great
|
|
|
|
|
The appcode folder is global to the whole application, then I loose isolation between debug and release code in my app.
/\ |_ E X E GG
|
|
|
|
|
Someone else was asking this the other day. You can't. You just can't. test.aspx.cs does NOT exist when default.aspx.cs is running. The class instances are created as the pages are served. If you have stuff you want to be able to call from many pages, give them a common base class.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Ok, then that clears it up. So I guess my next solution would be to put the common code I need, into an app_code folder.
/\ |_ E X E GG
|
|
|
|
|
Hi, if I don't want to use a DataGrid and don't want to use Stored Procedures for Paging purposes, what other options do I have? Would you please point me to tutorials on them if they exist, thank you in advance for your help.
|
|
|
|
|
Hi,
Usually I use Stored Procedure for paging. If U want paging without datagrid is okay, but if U dont want to use stored procedure then U should create a class for paging. It means for easy maintenance.
Regard,
Edwin
|
|
|
|
|
ASPnoob wrote: don't want to use Stored Procedures for Paging purposes
What is the role of stored procedure in paging. If know to implement manual paging with help of stored procedures, copy the same query to your page and append to string variable and pass to DB.
Do you have any specific reason for avoiding stored procedure ?
|
|
|
|
|
Hi,
I have a regular select statement, but it doesn't shows any data, may be I don't see sth, could anybody help me?
Here is the code:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:PapersDBConnectionString %>"
SelectCommand = "SELECT name, lastname, organization, addressline1, addressline2, city, state, country, zipcode, phone, newuser, moderator, date FROM Users WHERE (username = @current_user)">
<SelectParameters>
<asp:SessionParameter Name="current_user" SessionField="CURRENT_USER" />
</SelectParameters>
</asp:SqlDataSource>
thanx
|
|
|
|
|
I used following code and i get result
u can try it
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:RelationshipPortalConnectionString %>"
="" selectcommand="SELECT * FROM [User_Registration] WHERE ([UserName] = @UserName)">
<selectparameters>
<asp:sessionparameter name="UserName" sessionfield="UserName" type="String">
-- modified at 6:47 Wednesday 1st August, 2007
Nand Kumar das
|
|
|
|
|
Hi,
My Provider is System.Data.OracleClient. I need to use the OracleTransaction with Enterprise Library Data Access Application Blocks. With out DAAB we can write Like this:
OracleConnection con=”…”
OracleTransaction tr=Con.BeginTransaction(..);
With DAAB we have to write like this:
Database db=DatabaseFactory.createdatabase();
OreacleTransaction tr=?
Here How to initialize the Transaction.
Can any one provide me the link to how to execute Oracle Transactions with DAAB
Thanks
|
|
|
|
|
Have a look at this link[^], if you look at one of his replies (almost towards the end), he shows how to use DAAB with transactions.
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
There are two kinds of people, those who do the work and those who take the credit. Try to be in the first group; there is less competition there. - Indira Gandhi
|
|
|
|
|
Hi, suppose I connect to a database to retrieve binary data from a field called Resume and retrieve the mime type from the DocTypes field (DocTypes field stores "application/doc, image/img, etc.). I then use a data reader to read the data and then use the Response.ContentType=DirectCast(Read"DocType",String) to set its mime type. WhatI would like to know is, if the select statement used to retrieve the data retrieves more than one file, which DocType will be used in Response.ContentType=DirectCast(Read"DocType",String) . Also if I decide to display the data using Response.Write(), whic file will be diplayed? I hope I'm making sense, thank you in advance for your help.
-- modified at 17:55 Tuesday 31st July, 2007
|
|
|
|
|
A datareader will return a set of rows, the order of which is determined by your sql query. If you are simply reading the first one then that is what will be displayed; otherwise you could loop through them and pick out whichever one you wanted (perhaps determined by an id passed in the querystring, though in that case you'd just return the one row to begin with. Really, for your scenario, you do only want to return the one row you want to display, and ought to try and make sure your datareader does only fetch that one row.)
|
|
|
|
|
Hi, thanks for your response. Up 'til now I've been using a dataset and filling it using the data adapter Fill() method, but haven't used data reads that much. You said the order in which the rows are returned is determined by my SQL query, do you mean using the key word DESC or ASC? Also how do I loop through and pick what I want? Do I first put the retrieved data somewhere like a dataset then loop throught it? Please explain, thanks again for your help.
-- modified at 18:40 Tuesday 31st July, 2007
|
|
|
|
|
ASPnoob wrote: do you mean using the key word DESC or ASC?
well, yes, amongst other things - basically the ORDER BY clause of your query
Dim objReader as SqlDataReader
Dim objCmd as New SqlCommand
...
objCmd.CommandText = "SELECT ... FROM ... WHERE ... ORDER BY..."
objReader = objCmd.ExecuteReader
If objReader.HasRows Then
Do While objReader.Read
' do stuff / test for condition
Loop
End If
objReader.Close
But really, I would have thought you would have determined the record you want to display already, probably on a previous page, and are calling this page with the ID (perhaps) of that one record, so you can retrieve it and set the page Response.ContentType accordingly - in which case you don't need to Do...Loop at all - just SELECT that one record in your SQL query
objCmd.CommandText = "SELECT ... WHERE ID = " & request("id")
objReader = objCmd.ExecuteReader
objReader.Read
...
Good luck - if you need more try looking up the 4guysfromrolla site - loads of examples - - I'mm off to bed!
Fred
|
|
|
|
|
Hi !
Thank you for reading this. Here is my problem. Iam creating a domain cookie so, other sites in my app can read values. How can i delete the cookie from the other site??? For example.. lets say my main site is www.abc.com, when user logs in, i create a domain level cookie like this
Dim cookie1 As HttpCookie = New HttpCookie("Cookie",1234567)
cookie1.Domain = ".abc.com"
cookie1.expires=datetime.now.addminutes(30d)
Response.Cookies.Add(cookie1)
this creates my domain cookie. my other site(lets say test.abc.com) reads this cookie...now i want to delete the domain cookie from test.abc.com. How do i do it? All help and code example are much appreciated.
Thanks
RH
|
|
|
|
|
set its "expires" property to a date in the past.
If you want to do this across domains though, you may find that the user has set their browser security settings to prohibit you from doing this. Nothing you can do about that.
|
|
|
|
|
Hi
When u r entering to other site, u first check for that cookie and remove it.
I have not failed. I've just found 10,000 ways that won't work. -Thomas A. Edison
Thank u
Chandu
|
|
|
|
|
I have the following requirement:
E.g., on the UI, I have a grid with a list of items (having an unique id) and next to those items, I have a info icon which has a brief description about the item. The "text" that goes in the description is supplied to me by business and they want to have an ability to change it without code changes.
One way would be having an XML file like:
<infotips>
<infotip>
<id>101</id>
<name>Information 1</name>
<infotext>This is a description of Information 1</infotext>
</infotips>
<infotip>
<id>102</id>
<name>Information 2</name>
<infotext>This is a description of Information 2</infotext>
</infotips>
</infotips>
The problem is that XML file can easily be messed up by a simple typo or a special character. Enclosing in CDATA would still have the vulnerability of inputting improper XML structure.
So the question is, what is a good way to handle this type of scenario?
Thx in advance.
|
|
|
|
|
Could I use plsql decode to change value of a column in same record after checking for a condition in another column...
SELECT supplier_name,
decode(supplier_id, 10000, 'IBM',
10001, 'Microsoft',
10002, 'Hewlett Packard',
'Gateway') result
FROM suppliers;
|
|
|
|
|
I found 2 solutions :
Objective:
A table having 2 columns flag and amt. If the flag = Y then the amount should be XXX
else the original amount should be printed.
Solution:
#1
select
decode( nvl(flag,'N'), 'Y', 'XXX', to_char(amt,'999.99') ) amt
from Arif_table
/
#2
select
(
CASE when nvl(flag,'N') = 'Y' then
'XXX'
ELSE
to_char(amt,'999.99')
END CASE
) amt
from Arif_table
/
|
|
|
|
|
Hi,
Im developing a property rentals website (.Net 2.0 c#) and need to produce a calendar on which property owners can indicate the availability of their property. Then in turn visitors to the site can view the calendar to see when its book or available.
Can anyone give me some ideas on how to do this, short of adding 365 fields in a database to account for each day of the year??? Any help or even links would be greatly appreciated as ive done some serious searches and cant find anything suitable.
Thanks in advance for your time!
Phil
|
|
|
|
|
It depends on how you want the screen to look like. I would store the date ranges for a particular property in a separate table and use a primary-foreign key to pull the data. If the calendar needs to show availability for a particular property, then you could get the date ranges from the database and set the dates in the calendar with a color or a style you want.
The default calendar in .net would not allow you to select multiple dates, you will have to create a custom control extending the calendar class. Override the OnDayRender property of the calendar and based on the data from database do a tablecell.ApplyStyle(tableitemstyle) for each of the dates.
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
There are two kinds of people, those who do the work and those who take the credit. Try to be in the first group; there is less competition there. - Indira Gandhi
|
|
|
|
|
Hi,
Thanks for the reply but its not quite what i was looking for (i dont think).
1) How do i go about recording availability without the user manually selecting every single date on which the property is available.
2) How do i store this data without having 365 data fields per year in which to store the availability of each individual date?
3) I dont quite follow what you mean by 'primary-foreign key'. Excuse my ignorance.
4) PLEASE PLEASE HELP.
Thanks!!!
Phil
|
|
|
|