|
What are you asking ? Do you want your file to open when it's double clicked ? That's a registry entry ( easily found with google ). Do you just want to create the file ? ( Just use the System.IO namespace, and all the info you'd find with google ) Do you want to know the specifics of a file format for your app ? We really can't tell you.
Christian Graus - C++ MVP
|
|
|
|
|
I am a new c# programmer. I am trying to understand ADO.NET. can anybody explain, how can store SQL Connection string in a text file or web.config file and how to call that in c#?
wMan
|
|
|
|
|
|
Hi...
How i can select all items in a CheckedListBox on selction of a first CheckedListBox item...?
Items in CheckedListBox are as follows-
'Selct All'
First Item
Second Item
Third Item
So on click of 1st CheckedListBox item(SelectAll), i want to select all items...How i can do this...?
Thanks in adavnce,
Vinay
|
|
|
|
|
This is bad UI. You can make it work, but select all should be a button, not one of the items in the list.
Christian Graus - C++ MVP
|
|
|
|
|
Christian Graus wrote: This is bad UI.
Not sure I agree with that. If you have a huge field of checkboxes, say to determine which fields to search on, one of the options could be All, which would select all of the checkboxes for you.
I've seen this done out in the wild, and it seems to make sense. Not saying there's not a better way, just saying I don't think it's a bad UI.
[edit]Ahh, it's a list box. Should have read that a little closer. I agree with Christian, use a button.[/edit]
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
I have to make this type of application....
since that is the requirement...so can u tell me ...
How i can do this...?
Regards,
Vinay
|
|
|
|
|
You absolutely must have a list of checkbox items, and the first item must say 'select all' ? A button is a better choice . But, if you must make a god awful UI, just handle the event for an item to be checked, check if it's the 'check all' item, and if it is, check them all.
Christian Graus - C++ MVP
|
|
|
|
|
Ok...Can u tell me if i give a single CheckBox(say 'Selct All') outside this CheckBoxList then How i can select all ites in CheckBoxList on selction that CheckBox(Selct All).
Thanks for all your replies,
Vinay
|
|
|
|
|
If there's no CheckAll method on the checkboxlist, use foreach on the items collection to check them all.
Christian Graus - C++ MVP
|
|
|
|
|
Hi..
Actually i dont know number of items are there in that CheckBoxList so can you tell me how i can use foreach loop for my CheckBoxList. How i'll get collection of items in that CheckBoxList.
Regards,
Vinay
|
|
|
|
|
Do you not know how for each works ?
foreach(CheckBoxListITem item in myBox.Items)
{
item.Checked = true;
}
I am sure that's not the type of the items, but that's how it looks.
Christian Graus - C++ MVP
|
|
|
|
|
you can you this too
<br />
for (int i = 0; i < this.checkedListBox1.Items.Count; i++)<br />
{<br />
this.checkedListBox1.SetItemChecked(i, true);<br />
}<br />
Regards
Shajeel
|
|
|
|
|
It doesn't matter what it is, having a check box that says 'select all' makes no sense, it should be a seperate control to the type of control that is being selected ( and probably a button )
Christian Graus - C++ MVP
|
|
|
|
|
My example doesn't say "Select All" it just says All like:
Which fields do you want to search:
[ ] All
[ ] Author
[ ] Text
[ ] Date
[ ] Etc.
Granted you could write the same thing with radio buttons or something, like:
( ) All
( ) Selected
[ ] Author
[ ] Text
[ ] Date
[ ] Etc.
But I'd say the first one makes equally as much sense to most users, especially when it selects all the other check boxes.
It's just a shortcut, in either case.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Hello Everyone,
I am trying to pass two dates to a stored procedure in SQL server. I only require the date protion of the input not the time, but I cannot seem to get the formatting to just mm/dd/yyyy
the data is collected from two text boxes on a web form and is imput as string in the format mm/dd/yyyy.
The SP is expecting datetime parameters.
I have tried so many variations to this I am wondering if it can even be done????
DateTime FromDate = DateTime.ParseExact(tempdt, "mm/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture);
DateTime Todate = Convert.ToDateTime(ToDateLbl.Text);
None of these work.
All help grealy accepted.
|
|
|
|
|
Jagannatha108 wrote: DateTime FromDate = DateTime.ParseExact(tempdt, "mm/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture);
Change "mm/dd/yyyy" to "MM/dd/yyyy"
|
|
|
|
|
Sorry Jon, this still did not format my date to MM/DD/YYYY.
string tempfrmdt = FromDateLbl.Text;
string tmptodte = ToDateLbl.Text;
DateTime FromDate = DateTime.ParseExact(tempfrmdt, "MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture);
DateTime Todate = DateTime.ParseExact(tmptodte, "MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture);
Retuned the date as mm/dd/yyyy hh:mm:ss, not what I need.
Thanks for the suggestion though.
|
|
|
|
|
So, essentially you just need a string representation of the DATETIME parameters in the sproc? You can just use the CONVERT() T-SQL function to do that.
SET @varcharFromDate = CONVERT(VARCHAR(10), @FromDate, 101)
SET @varcharToDate = CONVERT(VARCHAR(10), @ToDate, 101)
Is that what you're asking? If not, then I'm not exactly clear on what the problem is.
|
|
|
|
|
So what your saying is...
Change,
ALTER PROCEDURE dbo.ShortCallsDateRange
(
@FromDate DATETIME,
@ToDate DATETIME,
@CallCount INT OUTPUT
)
AS
BEGIN
SELECT @CallCount = Count(*)
FROM HD_Call
WHERE (CONVERT(DATETIME, dateraised, 101) >= @FromDate AND (CONVERT(DATETIME, dateraised, 101) < @ToDate));
SELECT call, status, assignee, dateraised, shortrequest, shortaction
FROM HD_Call
WHERE (CONVERT(DATETIME, dateraised, 101) >= @FromDate AND (CONVERT(DATETIME, dateraised, 101) < @ToDate))
END
RETURN
To
ALTER PROCEDURE dbo.ShortCallsDateRange
(
@FromDate VARCHAR,
@ToDate VARCHAR,
@CallCount INT OUTPUT
)
AS
BEGIN
SELECT @CallCount = Count(*)
FROM HD_Call
WHERE (CONVERT(VARCHAR, dateraised, 101) >= @FromDate AND (CONVERT(VARCHAR, dateraised, 101) < @ToDate));
SELECT call, status, assignee, dateraised, shortrequest, shortaction
FROM HD_Call
WHERE (CONVERT(VARCHAR, dateraised, 101) >= @FromDate AND (CONVERT(VARCHAR, dateraised, 101) < @ToDate))
END
RETURN
Sorry for being confusing.
I was not sure if I could do the convert thing with datetime variables from C# to Sproc.
I will give it a go now.
Thanks for your persistent patients.
|
|
|
|
|
Ok, now that I have seen the code, I think it is better that you leave it as it is.
In your C# calling code, do this:
DateTime FromDate = DateTime.ParseExact("11/22/2006", "MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture);
DateTime ToDate = DateTime.ParseExact("11/30/2006", "MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture);
ToDate = new DateTime (ToDate.Year, ToDate.Month, ToDate.Day, 23, 59, 59);
(Of course, replace my dates with your variables that you're trying to convert.)
This will give you a FromDate of "11/22/2006 00:00:00", and a ToDate of "11/30/2006 23:59:59", which I assume is what you want. So, any value in the dateraised column that is between 11/22/2006 and 11/30/2006 inclusive will be returned.
Edit: You'll may need to change "< @ToDate" to "<= @ToDate" in your sproc, depending on how your logic works.
|
|
|
|
|
My Senior Design Group for school recently purchased a pair of Xpress Ethernet Bridges. On one end, we will have a single board computer aboard a robot while the other end is a laptop. 1 Ethernet bridge is connected to the laptop and the other is onboard the robot. I have a GUI started in C#.NET and now I am trying to send data to and from the robot via these ethernet bridges. I am able to send data if I connect two computers to the internet, however when i use the ethernet bridges(not connected to the internet) I am unable to send data to and from the robot and laptop. Im not asking for anyone to write any code for me, I am just curious if you can turn me in the right direction.
If I need to supply more info or current code, I can post that as well.....
Thanks!!
|
|
|
|
|
Sorry I cannot help you out, but just wanted to say that your project sounds very interesting and wish you the best of luck with it
Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon
|
|
|
|
|
do they definitely connect to each other via tools other than c#?
have you tried all the stuff like pinging the robot from the commandline?
I assume that both machines have picked up valid IP addresses on the same subnet and aren't sitting there searching for dhcp servers or similar.
HTH
Russ
|
|
|
|
|
OK, you know the .resx files created for every form, control, etc that has resources stored in it(ie. strings, images, etc)? Well, what I need to do is to make a component that would essentially feature a design time property dialog, aloowing me to add items to this component. Just simple items - name and value, both strings. What it would do then, is save this list of values to the .resx file of the form or control on which this component would reside. I have absolutely no idea where to begin with this, so any help at all is appreciated.
Hrm, I also need it to write to those .resx files, not some other place - the application is localizable, so whichever is the current culture selected, thats where it writes.
Sorry if that sounded too demanding, but I'm rushing this.
Thanks in advance,
Anton.
|
|
|
|
|