|
u can use datagrid control and bind it with ur dataset to display records.
rahul
|
|
|
|
|
yes ,but i am a beginner,so i want the code.
Thanks,
Kalyan
|
|
|
|
|
SO try Google. The idea of CP is to help with problems, not do someones job for them - be it a proper job or a piece of student course work.
If you want code writing try rentacoder.com
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Thanx for ur reply,i got it.
|
|
|
|
|
how to stop computer running process and start process using c#.
|
|
|
|
|
try System.Diagnostics.Start to strat external process.
rahul
|
|
|
|
|
Start and stop processes? Is that what you're asking? If so, look at System.Diagnostics.Process class.
|
|
|
|
|
you can start process using c# by this way:
using System.Diagnostics
.......
Process.Start("notepad.exe");
.......
Process.Start("cmd",@"/c mysqldump --user=root --password=123 mysql > c:\db.sql -t");//useful
.......
Process.Start("notepad.exe","c:\\record.txt");
.......
Process.Start("IEXPLORE.EXE","http://jnjx.126.com");
.......
Process.Start(@"C:\myFiles\MyApp.exe");
.....
and you can stop the process usingC# by this way:
//you can use the function
using System.Diagnostics;
..........
private void KillProcess(string processName)
{
Process myproc= new Process();
//
try
{
foreach(Process thisproc in Process.GetProcessesByName(processName))
{
thisproc.Kill();
}
}
catch(Exception Exc)
{
MessageBox.Show(Exc.Message);
}
}
//you can call this function like :KillProcess("iexplore.exe");
|
|
|
|
|
Hello everyone,
Before retrieving a page from Http, it is possible to know what are the content type it will return? e.g. image, html, text?
My initiative is to know the content type before retrieving the content, since if the page contains image, video or audio, I will not retrieve the content to save space and reduce risk.
Any ways to know content type returned without actually retrieve the page?
thanks in advance,
George
|
|
|
|
|
George_George wrote: Any ways to know content type returned without actually retrieve the page?
The content type should be in the HTTP headers, you will need to get that at a minimum (only a few bytes of plain text).
|
|
|
|
|
Thanks leppie,
Which API could be used in C# to retrieve only the content type for a page without retrieving the whole page content?
regards,
George
|
|
|
|
|
how to write select quary sql server compact 3.5 ("SELECT * FROM Table1 WHERE name" is wrong)
|
|
|
|
|
Try specifying the fields you want to select, rather than *. SQL compact may force you to specify the fields. (No idea about this, but just a thought.)
|
|
|
|
|
I am playing with a program where I will need to have random image/images populated in either picture boxes or labels
I know how to create random numbers with the random next function but for the life of me I can NOT figure out how to create random images
I have all my images in three different imagelist (separated by category)
I have been looking online for tutorials but I am coming up empty handed…
Thank you for your time
|
|
|
|
|
you can
Try this[^]
this is asp.net example, you can use this concept in windows application also.
cheers,
Abhijit
|
|
|
|
|
A Customer can have multiple Products and a Product can be assigned to zero to more Customers
But, there are some items (such as BasePrice and DefaultPrefix) that are implicit to a customer-product relationship.
In the database this can be modeled as
Table Customer with Columns CustomerId, Name, etc.
Table Product with Columns ProductId, Name, etc.
Table CustomerProduct with Columns CustomerId, ProductId, BasePrice, DefaultPrefix, etc.
How would you model this as Domain Objects?
All I could think of is
Customer
..CustomerId
..Name
..AssignedProduct[] Products
Product
..ProductId
..Name
..Customer[] Customers
AssignedProduct : Product
..Customer Customer
..BasePrice
..DefaultPrefix
But that doesn't strike me as too slick (an Assigned Product has a Customer and a Customers[]???) and as this simplified example gets closer to what I actually have to model, this design starts to have problems among which is that NHibernate can't model some of this stuff
|
|
|
|
|
Hi.
Do you really need the customer relation in the product object?
If your app has a customer point of view, my suggestion would be:
Customer
..CustomerId
..Name
..AssignedProduct[] Products
Product
..ProductId
..Name
AssignedProduct : Product
..BasePrice
..DefaultPrefix
Kjetil
|
|
|
|
|
The short answer is no, multiple Customers can have instances of the same product (though in this case, different AssignedProduct) so it should be possible to navigate from Product to all Customers that are assigned it. Also, I've tried that set-up already and it has some more esoteric disadvantages.
The long answer is that this is a simplification of slightly more complicated schema. Basically, imagine the relations between Location, Customer, Product, and Container for a company which has multiple Locations at which it rents out Containers for Customers to store Product in. A Customer can exist at multiple Locations and a Location can have multiple customers (again, the existance of a relation entails additional data); a Customer can have mutliple Products and a Product can be assigned to multiple Customers - which have to be at a location to have a product assigned. Finally, each Product that is assigned to a customer can be stored in zero or more Containers.
The database in the meantime is not completely normalized, and since it is legacy, I cannot change it. It looks something like this:
Location
Customer
Product
Container
CustomerLocation with fk to Location, Customer
ProductCustomer with fk to Product, CustomerLocation
ContainerProduct with fk to Container, ProductCustomer
So, in addition to the set-up I postulated being a little awkward, it is actually currently impossible for me to map with NHibernate.
|
|
|
|
|
|
Wow...........................
But this site is only asking your programming related questions not your personal problems,search job portal.
|
|
|
|
|
Their is a reason by jobs.codeproject.com was invented
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Hi,
I have a sql server + c# windows + Crystal Report application.
I have write and reading(reports) procedures on the application.
About the reading procedures, i thinking on displaying my reports on forms and use the crytal report only if user meent/wants to print a report!!!
What do you think, what is the most likely way to display a report?
nelsonpaixao@yahoo.com.br
|
|
|
|
|
From what I've read so far, it's supposedly impossible to inline MSIL in C#, the compiler just doesn't allow it. I thought I'd see what y'all had to say about it anyway...
I have a DLL project in C#, and a couple of one-line functions are a bit of a bottleneck right now. In C#, they look like
int bar()(
return x & 0x7FFFFFFF;
}
bool foo(){
return bar() == 0;
}
Looking at the MSIL, there's a bit of a performance boost I can get back changing the .maxstack value from 8 to 2 for both of these functions. My results of using optimized vs. unoptimized code are similar to the results this guy got:
http://bytes.com/forum/thread227229.html[^]
With .maxstack 8, there are a few extra stack pushes/pops, and registers are zeroed out and then moved, and moved again, and these things really don't seem to accomplish much at all. Changing to .maxstack 2 and reassembling removes these extra instructions, and there's a definite performance boost (maybe 25%). Overall the function is quick, but it gets called so many times that I'd like to improve it's performance any way I can. With the problem I'm working on right now, it's already taking 2 hours to process a common set of data. I'd like to get it down to 1 hour, but I'll settle for 1.5.
I can disassemble the DLL, change the IL, and reassemble it if absolutely necessary, but I'd have to do this anytime to recompile the DLL. I'd like to just inline the MSIL changes I need to make rather than reassemble the DLL every time. Is this even possible?
Thanks,
Dybs
|
|
|
|
|
Do you really have to have the methods in a separate dll? If you would put them in the assembly where you use them, the compiler should just inline them, and there wouldn't even be a method call...
Also, I'm not sure that you are looking in the right place to find optimisations... What is it really that makes the job take so long time?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
The DLL is part of the PowerCollections, and when we ran our code through a profiler ((ANTS Profiler from Red Gate)[^], the most time our code spent by far was in the Set.UnionWith() function (defined in the PowerCollections DLL). Since we have the source code for the DLL, we profiled that as well, and ultimately most of the time was being spent in checking if a particular bucket in the Set was empty or not (for handling collision). These 2 functions are essentially those I described in my original post. The problem really is that we call UnionWith() so many times in this particular feature of our code. We've limited the number of calls about as must as we can, we just have so much data that the customer needs us to analyze. I'd prefer not to get into too many more details since this is for work.
Regarding assemblies, I've done some reading on them but I still don't really understand how to use them, (i.e. put a method in an assembly). We actually wrote the same 2 functions in C++ and C#, with the same compiler optimization settings and compared the IL, and the C++ IL already had the changes we wanted to make to the C# IL, so we're assuming (is that a bad thing? ) the C++ and C# compilers just produce different IL for the essentially the same code.
Is there a chance we're misinterpreting what the profiler is telling us about our bottleneck? Again, we've tried reducing the number of calls as much as we can (it's essentially a dynamic programming problem, and we've managed to cache our results as much as memory allows - depending on our data set, our final results may take up around 5 GB.) I realize I haven't posted any code yet, but I'd appreciate any suggestions you may have on optimizing this, if inlining the IL isn't the right approach.
Thanks,
Dybs
|
|
|
|
|