|
It doesn't matter, i figured out how to do it with a list view, i tried to delete/edit the post a few times, but codeproject keeps crashing my browser >
Whta happens is, i come here, i try to do something (delete for example) the next page starts to load, the current browser window goes extremely slowly, all new windows go exrtremely slowly. The rest of the computer and any other previously open browser windows work fine though.
|
|
|
|
|
If you're having problems, the suggestions forum is the proper place to discus them.
|
|
|
|
|
When the page loads the dropdownlists do not display the date I want unless I press a button on the page and the page postsback to the server. I would like that date to be displayed once the page loads. Any hints?
if (Page.IsPostBack == false)
{
DateTime Yest = DateTime.Today.AddDays(-1);
string YestMonth = Yest.ToString("MMMM").Trim();
string YestDay = Yest.ToString("dd").Trim();
string YestYear = Yest.ToString("yyyy").Trim();
DropDownList2.SelectedItem.Value = YestYear.ToString();
DropDownList3.SelectedItem.Value = YestMonth.ToString();
DropDownList4.SelectedItem.Value = YestDay.ToString();
}
|
|
|
|
|
I do not see where you are inserting the values into the DropDownLists. You can not have a selected Item that does not exist in the DropDownList control. Below is the code I created, using some of your code from your question. I hope it helps.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DateTime Yest = DateTime.Today.AddDays(-1);
string YestMonth = Yest.ToString("MMMM").Trim();
string YestDay = Yest.ToString("dd").Trim();
string YestYear = Yest.ToString("yyyy").Trim();
ddlMain.Items.Insert(0, YestMonth);
ddlMain.SelectedItem.Value = YestYear.ToString();
}
}
|
|
|
|
|
The items are already inserted in design view. I am just trying to select one of those items. If I insert an item the way you want me to do it I will see duplicates of the same item in the dropdown list.
|
|
|
|
|
Not sure about dropdownlist on t'internet, but the equivelant is a combobax right?
Well even if its not
this.combobox1.SelectedItemValue = some_kinda_string;
doesn't work
this.combobox1.SelectedItem = some_kinda_string;
does work, so i guess that you want to be usin'
DropDownList2.SelectedItem = YestYear.ToString();<br />
DropDownList3.SelectedItem = YestMonth.ToString();<br />
DropDownList4.SelectedItem = YestDay.ToString();
If not, im all out of ideas.
|
|
|
|
|
Ok so it is the exact same thing minus the Insert property.
|
|
|
|
|
i have 2 forms Form1.cs and Form2.cs
i have generated mymodule.netmodule of these two using csc
now i want to generate exe from this module
i am using this command
al c:\mymodule.netmodule /t:exe /out:myexe.exe /main:Form1.Main
i have kept the form1 in the same directory where mymodule.netmodule is
(Form1 contains the main method )
but this give me the error
error AL1037: Unable to find the entry point method
'Form1.main'
|
|
|
|
|
hi.
i wanna execute a PHP file on a remote server in C# and retreive some data from that PHP file! beacuse MySQL server port is closed for remote login.
how can i do this?
maybe System.Net.WebClient class could be useful?
thanks
asamay
-- modified at 13:01 Tuesday 10th October, 2006
|
|
|
|
|
ok you did not google for it as i suggested you to do
WebClient myclient = new WebClient();
FileStream mystream = myclient.OpenRead("http://yourwebpage.net");
while (mystream.Peek() > -1)
{
string line = mystream.ReadLine();
}
i guess/hope this code retrieves the data of the specified page and reads it line by line until end of file.
please try to google for it the next time because there are so many existing pages and explanations about it... i know you even did not try to find something useful about it and thats kinda annoying and makes me not respond to posts like this - thats why if you expect anyone to answer you should follow their advises (or at least try to and tell them why you failed..)
|
|
|
|
|
thank you again Mikone, i have replied. i think u didn't see
your suggest was very helpful for me, i tried to find something in google,
but i just wanted to ask again, maybe somebody knows another method for to do that.
also im new on C#. there are lots of documents about it and i really didn't know where to start.
but now it looks easy. thank you again!!
asamay
|
|
|
|
|
i read the reply and you wrote "i will search for.." but 10 minutes later you already posted the same question again that's why i thought you weren't really searching
next time try to search for terms like:
- "system.net.webclient msdn" (first and third hit)
- "system.net.webclient tutorial" (second hit)
if you get no results when searching for these terms you could search for "webclient msdn/tutorial" or whatever. In generally the .net classes are well documented and they often provide examples.
if you cant find anything in google search for articles or posts in the messageboard - often people asked the same question and there already exists an answer right next to you
keep on learning (as everyone should ) - all this stuff will become less complicated!!
Good luck,
mik
|
|
|
|
|
i told u, maybe there is a another way to do!! i really looked at the net before u reply the first message! i read your 1st message about 2 hours ago before i replied.
anyway, thanks again for your advice!
|
|
|
|
|
Hello
I´m working with DataTAble and DataColumns. I would like to know how can i put the size of a column
THat is, now all the columns has the same size in the tables and i would like to know how can i create of differente sizes.
|
|
|
|
|
You can use the MaxLength property of the DataColumn object (for text columns only)
|
|
|
|
|
When you state size I am guessing that you mean string length. That is achieved by...
DataSet DS = new DataSet();
//Populate the dataset with tables and columns
//You can use column names, insead of index, if you have named them
DS.Tables[0].Columns[0].MaxLength = 20;
|
|
|
|
|
How can I make one crystal report and then generate that report for lets say about 200,000 people. What I am trying to get at is how can i modify the generated full report everytime for each specific person rather than just modifying a section for each person because to my understanding thats the only way i can do it now is by including grouped sections but can i generate whole individual reports for each person. Is there anyway to do that if so please help . Thank You
Raheel Chohan
|
|
|
|
|
|
If i wanted to sort a list of say, 10 things that'd go pretty quick right?
Well, how well would it work out on a list of 1000 things?
|
|
|
|
|
Even on a list of 1000 things, a bubble sort will be pretty quick. Its when you start hitting millions (well, at least hundreds of thousands) that you'll notice the difference.
A quick google search found this page[^] which should provide some useful reading for you.
|
|
|
|
|
Ooh that is some useful reading, so for my problem the bubble sort would work just fine, and get back the results fairly quickly, ah.
But i might just use the quick sort anyways.
|
|
|
|
|
The idea of the bubble sort is the easiest of all, but this sort is almost always the slowest sort of all. It should be replaced, at the very least, with an Insertion or Ripple sort (which are just as easy to program) for small lists, and with one of the faster sorts, such as Shell sort, for longer lists. The only good place to use bubble sorts is if the list to be sorted is already essentially sorted!
- Ashish
Time flies like an arrow;
Fruit flies like a banana.
Ashish Derhgawen - http://ashishrd.blogspot.com
|
|
|
|
|
Ashish Derhgawen wrote: he only good place to use bubble sorts is if the list to be sorted is already essentially sorted!
Selection/insertion are still faster there.
The only place for a bubble sort is on an exam when you're not allowed to a canned Sort() function, but instead have to write your own.
|
|
|
|
|
Bubble sort takes O(n²) time. Do yourself a favor and get to know a O(n log n) sorting algorithm. I think merge sort is the simplest to learn. Small comparison:
For 100000 elements: Bubble sort takes 800 seconds (that's 13.3 minutes) while merge sort only takes 0.6 seconds.
Quick sort is a even faster than merge sort (but not very much), but hard to do right.
|
|
|
|
|
Oh, and since this is the C# forum and not the Algorithms forum:
Remember there are built-in sorting functions in the .NET Framework which implement quick sort. If you have an array, just call Array.Sort(myArray), on a List<t>, call myList.Sort().
Both sorting methods have overloads that take a custom comparison function in case you want to sort by a different criteria than the default for the data type is.
|
|
|
|