|
<%# Eval("Birthday", "{0:yyy-mm-dd}") %><pre>
|
|
|
|
|
Can't them be find by FormView.FindControls method in EdititemTemplate.
How get those controls in EdititemTemplate?
|
|
|
|
|
|
Hi everyone,
Is there a way to automatically delete information from fields in a database after sometime has passed? For example if I want to delete a user's info from my database after he or she has been inactive for so long? Is there a setting in SQL 2005 that would let me do that or must I do it programmatically? Please explain the details of how to do this if you can or point me to a site that goes into details on this. Thank you in advance for your help.
modified on Tuesday, April 29, 2008 10:31 PM
|
|
|
|
|
No, you can't do that. You can store a date stamp on a record, and the next time the DB is accessed, delete it as having timed out.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi there Christian, I haven't bugged you in a while. So are saying that I can not automatically delete data from a SQL database through code and instead would have to delete it manually? If I write a function to access the database to make it search for the datetime field that has reached a preset time, then tell it to delete all info in the same row as the datetime, I think it would be possible to what I intended. The only problem is the function would have to be triggered by something outside of the database if the database can't communicate with the function. What is your opinion on that? Please give a better solution if you can think of one. Thanks in advance for your time.
|
|
|
|
|
The main thing is, your DB won't do anything on it's own. You can write a service that calls the DB to delete timed out records, but the record doesn't matter until your next request anyhow, right ? So, just time stamp them and delete them before reading data from that table again.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi there Christian, I haven't bugged you in a while. So you are saying that I can not automatically delete data from a SQL database through code and instead would have to delete it manually? If I write a function to access the database to make it search for the datetime field that has reached a time limit, then tell it to delete all info in the same row as the datetime, I think it would be possible to what I intended. The only problem is the function would have to be triggered by something outside of the database if the database can't communicate with the function. What is your opinion on that? Please give a better solution if you can think of one. Thanks in advance for your time.
modified on Wednesday, April 30, 2008 12:14 AM
|
|
|
|
|
|
Hi All,
i have this code with VB.net but i'm using C#,how I can convert this code to C#?(i try use web converter but my broblem not be solved)
<code>Dim Price As String=Double.Parse(CType(DataList1.Controls(0).FindControl("PriceLabel",Label).Text)</code>
please help me,
Thank you
Hoda
|
|
|
|
|
string Price ="";<br />
Price = Double.Parse(((Label)DataList1.Controls[0].FindControl("PriceLabel")).Text);
I Love T-SQL
|
|
|
|
|
That won't compile. Unlike VB, C# is typesafe.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank you.
I Love T-SQL
|
|
|
|
|
Wow - the usual VB.NET nastiness. This code sucks. Here's the (better) C# version
string Price = ((Label)DataList1.Controls[0].FindControl("PriceLabel")).Text;
Breaking it down to make sure FindControl returns something, is an even better idea.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You'd get much better results from any converter by starting with legitimate VB code. Your parentheses are not placed correctly - how would you expect a converter to sort out misplaced parentheses?
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
Java to VB & C# Converter: convert Java to VB or C#
|
|
|
|
|
Hi
on my example I use a gridview to view product data ,,,
like id, name , etc .
and I added unbound column , Cost ,,,
all other columns is bounded ,i'd like to allow the user to enter Cost value only,,
how can i do that ,,
i'm sorry for all ,, it's my first project on asp.net
jooooo
|
|
|
|
|
I am always troubled by people whose 'first ASP.NET project' sounds suspiciously like a paid project.
You can render a textbox in a row, the hard part is probably workout out how to access that data. I'd try doing a postback and iterating over the control to see if the textbox viewstate makes it OK.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
God give you the ability for helping us ,,,
I appreciate you efforts ,, and really thanks
jooooo
modified on Wednesday, April 30, 2008 6:35 AM
|
|
|
|
|
First off, I am sorry to post this question. I promise I did search for exactly what I needed concerning my particular interest but I can only find issues and comments that are beyond what I need.
My simple problem is that I have a windows app written in C# that will display a PDF file, in Adobe, using Process (opening the app externally). I pass the file name in the Process.StartInfo.Argument value. Everything works well, but now I am asked to do this in a web page.
I have searched for just a simple way to display a pdf file in a web page (aspx) and cannot find a tutorial, comment or any thing. Everywhere I have search usually had to do with converting or something else that is more than what I need.I don't have to do any conversions or special rendering, I just have to pass the .pdf file name somewhere so that the page can display it.
Any help would be greatly appreciated.
|
|
|
|
|
Basically, you need your user to have Acrobat, just like your windows app. You can just link to a PDF and the browser should open it, or you can set the content type and use response.binarywrite to pass a pdf down in response to a page event.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
As always thank you for your help. It works great both ways.
Take care Mr. Graus.
|
|
|
|
|
I have a hidden panel where I have a TextBox. When the panel is displayed, the TextBox loses focus.
I say loses because if the panel is initially displayed, then the TextBox gets the focus. But if you hide it, then come back (show it), focus from the TextBox is gone.
FYI, I'm also using AJAX's UpdatePanel around these.
Any idea?
Thanks.
Ekjon
|
|
|
|
|
How are you maitaining the Focus for textbox ?
Could u post the code for focusing the TextBox ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Dude ...i Suggest You ..to do the task by Java Script Take a pannel as u have done so and a button when button one is click call a function in javascript check the property of panel as document.getElementById('panel1').style.display == ""
if yes make it equal to none
if not make it equal to ""
and after this statement add document.form1['TextBox1.focus();
work is over ...
i suggest you to work on code do not rely on ajax
Happy Programming
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
Hi Sandeep,
Thanks for your response.
Both in the Page Load and the Click event handler for my link button, I have the following:
<br />
if (pnlSearch.Visible == true)<br />
{<br />
form1.DefaultFocus = "txtSearch";
}<br />
Ekjon
|
|
|
|