|
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.
|
|
|
|
|
Daniel Grunwald wrote: Remember there are built-in sorting functions in the .NET Framework which implement quick sort.
As far as I know first a quicksort is used to "divide and conquer", but for sublists with <=7 elements the insertion sort is used. That's at least the case in the C++ STL.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Greeeg wrote: As far as I know first a quicksort is used to "divide and conquer", but for sublists with <=7 elements the insertion sort is used. That's at least the case in the C++ STL.
Interesting. Is that an empirical point beyond which the recursive overload becomes larger than the savings of nlogn vs n^2.
|
|
|
|
|
Yeah something like that. This explains it a bit better.
The June 2000 SGI C++ Standard Template Library stl_algo.h implementation of unstable sort uses the Musser introsort approach with the recursion depth to switch to heapsort passed as a parameter, median-of-3 pivot selection and the Sedgewick final insertion sort pass. The element threshold for switching to the simple insertion sort was 16.
Okay, a bit different
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
My project is CMat, with RderTable in RderDataSet with
columns Descr and Price. OrderEntryForm and ViewOrderForm with dataGridView1 in OEForm and reportViewer1 in VOForm.
reportViewer1 uses report1.rdlc with table1.
OEForm generated rderDataSet and rderTableBindingSource & VOForm generated RderDataSet and RderTableBindingSource when fields dragged from DataSource Window. I click a Button in OEForm to ShowDialog VOForm. I tried to insert
RderTableBindingSource.DataSource = rderTableBindingSource.DataSource or rderDataSet.RderTable
before, this.reportViewer1.RefreshReport in VOForm_Load
- error "does not exist in current context"
Please help me view the active Order entry table filled by rderDataSet.ReadXml, in a reportViewer1.
Ramith Sivanarain
-- modified at 9:52 Thursday 12th October, 2006
|
|
|
|
|
Hi everybody!
I want to scan the ports on my computer, and I'm looking for the right class to do that.
any clues please?
thanks!
|
|
|
|
|
Hi!
I'm not sure about this but you could try to do it like this:
<br />
System.Net.Sockets.TcpClient myclient = new System.Net.Sockets.TcpClient();<br />
for (int i = 0; i < 65535; i++)<br />
{<br />
try<br />
{<br />
myclient.Connect("localhost", i);<br />
}<br />
catch<br />
{<br />
}<br />
}<br />
This method is obviously not the best because it uses a try..catch statement and it will also throw an exception if a particular port is blocked by another application.
To get around this issue you will have to extend the exceptionhandling massively.
That's how i would do it but as already mentioned i'm pretty unexperienced...
Good luck,
mik
|
|
|
|
|
Hi
I thought about this method, but its really not an efficient one.
thanks alot anyway!
|
|
|
|
|
Good Morning,
i have a problem!
i have a form with a TextBox and DataGrid.
i fill a DataGrid with DataBase records
and when i select a record in DataGrid i show it in textbox!
But i want to type a character at textbox and automatically locate the record in DataGrid (Partial key search)!
Thanks a lot!
|
|
|
|
|
Hello,
you can use a Filter on the Datagrid:
At first, you must create a DataView on your table.
DataView dv = new DataView();
dv.Table = MyDataSet.Tables["Suppliers"];
Then you can set the RowFilter like this : dv.RowFilter = "City = 'Berlin'";
You can use different FilterOptions, like in SQL : dv.RowFilter = "Name = 'S%'";
S% -> All that begans with S
( Naturally it seems in you case like this : dv.RowFilter = "Name = '" + textbox.Text + "%'";
Then you choose the DataView as DataSource of the Grid
There are propably some errors im my example, but the logic is right
( I used it before 1 year and i still don't have the code here )
Good luck
|
|
|
|