|
SELECT MIN(CONVERT(varchar, DateCreated, 111)) FROM tblsummary
|
|
|
|
|
SELECT MIN(CONVERT(varchar, DateCreated, 111)) FROM tblsummary
error in query analyzer:
Invalid Columnname 'DateCreated'.
'accessdate' column in 'tblsummary'table has 'datetime' datatype.
Did u understand my problem in last post?
My query is not checking month.
Does 'datetime' datatype takes data in database as 'mm/dd/yyyy'?
I inserted data as 'dd/mm/yyyy'.
|
|
|
|
|
Please don't use txtspk. This is a forum, not a text message.
Store the dates as dates, not as text. Otherwise you have to convert each value to date in the query to get the aggregate to compare them as dates.
---
single minded; short sighted; long gone;
|
|
|
|
|
date is stored in database in only one way. u have to fatch date as u want in any format.
y'r prob solved with above posted ans. query .
|
|
|
|
|
yes my problem is solved.
datetime datatype stores data in mm/dd/yyyy format.
now its working.
thank you.
|
|
|
|
|
which query u r using for fetch min date from database.
|
|
|
|
|
hi
in C#, how can i make a varible to access globally, through out my project.
Regards,
Selva.
|
|
|
|
|
if u want to read the value of any variable through out the project then u can declare it in app.config file through key and value tag,and can read it any time using System.Configuration.ConfigurationSettings.AppSettings["key"].ToString();
rahul
|
|
|
|
|
You can declare the variable (say myVar ) as a static member of a class (say myClass ) and then access it, wherever you need, simply using myClass.myVar .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
hello people,
I have an sql connection like the following. it works perfectly fine. I am using sql server'05.
SqlConnection conn = new SqlConnection("Data Source=" + Environment.MachineName + "\\WINCC;Integrated Security=SSPI;Initial Catalog=Logger; Packet Size = 32766;");
However, i want to have a connection so that my application runs on any machine, that does not have the sql server.
thanks
Keshav Kamat
India
|
|
|
|
|
Keshav V. Kamat wrote: i want to have a connection so that my application runs on any machine
Activate TCP/IP and the "Server Browser Service" in the SQLServer's configuration dialog.
Locally, the SQLServer uses Named Pipes fpor comminucation with clients.
To talk to remote clients, it needs CP/IP.
To find the instance "WINCC" by name, the clients need the browsing service.
____________________________________
There is no proof for this sentence.
|
|
|
|
|
Thanks.
But still, I want the connection to work when there is no SQL installed on a machine.
instance "WINCC" is fine. i could let an open file dialog or a simple text box do the job.
But I feel creating a database without any data source would be impossible.
thanks anyways.
Keshav Kamat
India
|
|
|
|
|
SQLServer can run on any remote machine. The client application finds the server by servername\instancename in the connection string. Activate TCP/IP and Browser Service on the remote server and your clients will run fine.
____________________________________
There is no proof for this sentence.
|
|
|
|
|
Hi,all
I am creating a editor and main from is made as an MDI parent and i want to implement a Find Functionality..
if i opened the Find form and Minimize the main from the find also should be minimized ..
i want something like pls refer..
open notepad Type somethingclick Find and minimize the notepad....
the find form also will be minimized like...
the same thing
With Regards
prasad
|
|
|
|
|
Hi, i try to help you.
If Form2 should do the same like Form1, you should try to create the Form2 in Form1.
So you have a reference to the Form2. You create form2 for example at the constructor of form1.
MyForm1::MyForm1(void)
{
OtherForm = new MyForm2; ( OtherForm should be a class member, to have all the time an access)
}
then you derive the ShowDialog() Method. there in you call naturally the base-method and then the ShowDialog of the Form2 "OtherForm.ShowDialog"
In this way you proceed with all methods you need.
If ShowDialog is protected/private for Form2, you need to derive also ShowDialog from Form2 but
as public.
I hope i could help you a little bit.
Good luck
|
|
|
|
|
hi,friend
i will clear it u
I am creating a editor and main from is made as an MDI parent and i want to implement a Find Functionality..
if i opened the Find form and Minimize the main from the find also should be minimized ..
i want something like pls refer..
open notepad Type somethingclick Find and minimize the notepad....
the same thing
With Regatds
prasad
|
|
|
|
|
1. Use Show(), not ShowDialog()
2. Use event SizeChanged in Form1.
private void Form1_SizeChanged(object sender, EventArgs e)
{
this.form2.WindowState = this.WindowState;
}
|
|
|
|
|
hi,friend
i will clear it u
I am creating a editor and main from is made as an MDI parent and i want to implement a Find Functionality..
if i opened the Find form and Minimize the main from the find also should be minimized ..
i want something like pls refer..
open notepad Type somethingclick Find and minimize the notepad....
the same thing
With Regatds
prasad
|
|
|
|
|
yepp,
i came to the same solution.
But there is still the problem, that the "FindWindow" disappears behind the MainForm, if the
MainForm gets the focus.
But i never made things like this in C# before
|
|
|
|
|
Hi everyone,
Can anyone please tell me how do you get only the file name out of openFileDialog1.FileName, cuz I keep getting the path along with the file name.
Many thanks
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
<br />
string fileName = Path.GetFileName(openFileDialog1.FileName);<br />
|
|
|
|
|
Path what's this??
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hello,
Look at the System.IO namespace.
There you will find the path class, with a lot of fancy methods.
All the best,
Martin
|
|
|
|
|
Martin# wrote: ... a lot of fancy methods.
Thank you Martin, you're the fancy one
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
i hope this helps. this open file dialog is for xml files only. use the file extensions accordingly.
OpenFileDialog ofn = new OpenFileDialog();
ofn.Filter = "XML Files (*.xml)|*.xml";
ofn.Title = "Type File";
if (ofn.ShowDialog() == DialogResult.Ok)
{
}
then u can get the file name as
ofn.FileName
Keshav Kamat
India
|
|
|
|