|
Is this a stored procedure?
|
|
|
|
|
yes u have to write this in stored procedure .
|
|
|
|
|
K. Can u tell how to call procedures from Dotnet? Because i know only to call queries. It will be very helpfull.
|
|
|
|
|
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "store procedure name";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = con
|
|
|
|
|
You can also try this if you want to use the query
select * from table_name where convert(datetime,convert(varchar(30),stored_date,103),103)
between convert(datetime,convert(varchar(30),getdate()-2,103),103)
and convert(datetime,convert(varchar(30),getdate(),103),103)
You can take whatever number of days you want.
Regards,
Kaushal Arora
modified on Thursday, February 26, 2009 6:06 AM
|
|
|
|
|
I want to have a refresh that recalls the database to pick up changes. I have timers set up on different pages that call the database. (using System.Timers.Timer() ) But if a user moves to different page that has another timer I get more than one timer calling the database and this is bad for performance. What is the standard way to handle an automatic refresh?
Thanks in advanced
|
|
|
|
|
Hi,
How to create Custom Validator in Validation Application block? Does anyone provide links or some information?
|
|
|
|
|
Shivajiwow wrote:
How to create Custom Validator in Validation Application block? Does anyone provide links or some information?
Have a look[^]
|
|
|
|
|
Hi Abhijeet,
I installed Validation library 4.0 but i didnt get any Application Block Software Factory.
So how to get that?
|
|
|
|
|
Hello Everybody
I have already posted a similar topic but that one was bit confusing. This is why I am writting again.
1. Customer can choose date and time from textbox or dropdown.
When customer click submit button then I want to check whether their selected date and time 8 hours more than system date and time or not.
For Example:
System.Today.DateTime = 10/02/09 05:06:50 , I want to compare System.Today.DateTime with customer selected data and time.
Please help me
Thanks in Advance
Sarfaraj
Sarfarj Ahmed
|
|
|
|
|
Sarfaraj Ahmed wrote: I have already posted a similar topic but that one was bit confusing. This is why I am writting again.
There is no need of repost. If that was not clear, please modify that one rather than Cross Post.
|
|
|
|
|
thank you very much
Sarfarj Ahmed
|
|
|
|
|
i have not read you last post. from this one if I understood you correct,
DateTime current = DateTime.Now;
Timespan t = current.Subtract(inputDate );
The timespan object will have the difference. i.e. re.TotalHours will have the hour difference.
|
|
|
|
|
Thank You very much
your code does make sense.
Could you please tell me a bit detail
1. You are right, input is coming from customer
2. If I substract the input then do I need to specifie any format ex. 10/02/09 5:47
Sarfarj Ahmed
|
|
|
|
|
Convert.ToDateTime uses the current culture. If you want to do culture specific stuff then u wud have to use DateTime.Parse passing it the culture.
|
|
|
|
|
is their anything i can to calculate difrence only hour, eg:
1. 60 hours
2. Not 2 Days and 12 hours
Sarfarj Ahmed
|
|
|
|
|
Timespan's TotalHours property does give you the total difference of hours ?
|
|
|
|
|
I have some files saved in a folder that I need to insert into a 2000 server. Can someone please help me with code for 2003.
I can't use the HtmlInputFile control
|
|
|
|
|
Anita_Kamat_inds wrote: I can't use the HtmlInputFile control
There is no other possibilities. ASP.NET can't read the folder and put files to DB.
|
|
|
|
|
well I used this and it works.
string sFilePath = @"C:\FF73JJ0000.tif";
byte[] bFile = new byte[fs.Length];
fs.Read(bFile, 0, bFile.Length);
SqlConnection connection = new SqlConnection(connectionString);
connection.Open ();
SqlCommand cmd = new SqlCommand ("insert into tblViewContracts "
+ "(ViewImage) values (@pic)", connection);
cmd.Parameters.Add ("@pic", bFile);
this kinds of works.
|
|
|
|
|
Yeah. So the folder will be on server?
|
|
|
|
|
|
Ok. I was thinking the folder is on client. BTW, what is the issue you are facing? You said the code provided is working.
|
|
|
|
|
yeah, at that time I needed help. I got it now. thanks man for atleast responding. if you don't mind can you tell me if a asp.net application application is accessing file on a server, is there a particular user that needs access too the server.
|
|
|
|
|
Anita_Kamat_inds wrote: is there a particular user that needs access too the server.
Usually ASP.NET user account will have read/write access in the website area. If not, it can be granted from the Properties window of that directory. Code accessing C:\SomeFolder may fail as ASP.NET will not have access to directories outside website area.
|
|
|
|