|
Yes,
In fact date is a long formatted number.
If you will try to write the fololowing code:
Dim d as date ="31/12/1899"
msgbox(Clng(d))
You will get 1
"31/12/1899" is the first date from it we start to count.
To answer to your question, try this:
'This is in VB6, if you need it in VB.NET, tell me
Dim d As Date
d = "31/12/1899"
Label1.Caption = CDate(CLng(d))
Label1.caption result will be "31/12/1899".
I hope it helps you.
Shay Noy
|
|
|
|
|
try this in your query
"SELECT date1 FROM emptimepolicies where month(date1)>2 and day(date1)>1 and year(date1)>2006"
i try that in my query analyzer and its works fine
Regards,
Tomi
|
|
|
|
|
Woh .it is working very fine.
Thanks a lot
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Anytime Sonia..
Glad can solve u'r problem
Kind Regards,
Tomi
|
|
|
|
|
I have 2 asp.net files: default.aspx.cs and test.aspx.cs
How can I call methods from test.aspx.cs from default.aspx.cs?
I can't seem to call methods from a different file unless it's in my appcode folder.
/\ |_ E X E GG
|
|
|
|
|
i think function calling is posible if class is placed in appcode folder.
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Try this code
Use this line where u want to call Function
In .aspx page
<%@ PreviousPageType VirtualPath="~/index.aspx" %>
in .aspx.cs
this.PreviousPage.Login();
//Make sure your method is public
Best Regard
Pathan
-- modified at 0:54 Wednesday 1st August, 2007
---------------------------------------------------
|
|
|
|
|
imran i tried ur code
i got the following exceptions
Object reference not set to an instance of an object.
at the following line
this.PreviousPage.Login();
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Now try this
take two page test1.aspx and test2.aspx
Take LinkButton in test1.aspx
<asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl="~/test2.aspx">LinkButton</asp:LinkButton>
and write public method
i.e
public string Login()
{
return "Welcome";
}
Now In test2.aspx
<%@ PreviousPageType VirtualPath="~/test1.aspx" %>
Call Method in page load event
Response.Write(this.PreviousPage.Login());
Run test1.aspx and click on LinkButton
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
imran, have u tested the code u r providing.
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
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
|
|
|
|