|
well you could load all your rows into a datatable or something, then you create a bunch of buttons to act as page numbers, or a drop down list, based on the number of rows in the datatable.
So if you have 128 rows you could do...
int numberOfPages = numRows % 25 == 0 ? numRows / 25 : numRows / 25 + 1;
then on each button click, you load the first 25 result starting at a number obtained by...
int startRowNumber = (pageNumber - 1) * 25;
Alternatively you can get the startRowNumber and search you datasource for each page load. Depending on what your data source is will depend how you could do this. Some databases have functionality to specify a results count and start value. But you will have to look into that yourself
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
I want to close a form after showing another form from this form and other form still shown.
(in general whole application is closed)
ankur bansal
|
|
|
|
|
It depends on what you want, taking in consideration that there is a main form that shouldn't be closed, other forms could be, and you have the option of closing the forms or hiding them, preferrably is to close them of course except the main form which should be just hidden.
Sincerely Samer Abu Rabie
Imagination is more important than knowledge !
|
|
|
|
|
You can use your form as application.
In Program.cs file you can write it one by one.
Application.Run(new Form1());
Application.Run(new Form2());
If you can think then I Can.
|
|
|
|
|
Hi,
I had a small application of BHO using c#.
1. How to know Header Information when a web page is getting loaded on browser (IE)?
2. when we click a link http://mca.gov.in/MinistryWebsite/dca/help/efiling/NewFormsFees.pdf the PDF file is opened in other window (other tab),
how the pdf file is rendered in Internet explorer?
When the PDF file is opened in Ie, the PDF data is obtained packet by packet, How can I know that PDF is fully loaded on browser.
I want this to be done by using BHO as BHO gets injected, it performs the same thing for each and every instance of IE?
|
|
|
|
|
1. I have no idea since I've never written a BHO.
2. The PDF file is rendered by an plugin to Internet Explorer. Perhaps you've heard of Adobe Acrobat Reader??
svt gdwl wrote: When the PDF file is opened in Ie, the PDF data is obtained packet by packet, How can I know that PDF is fully loaded on browser.
The file is downloaded to the Temporary Internet Files folder. You may want to look into the DocumentComplete events. I have no idea if they will suit your needs or not.
|
|
|
|
|
Hi all,
I am transfering a 200mb data from my socket program to the client and i have the following error during execution. I guess it because of the huge data but am not sure in rectifying the issue. I have given the error below
"An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full"
Thanks
Maheshkumar B
|
|
|
|
|
Never seen it before but it sounds like buffer overrrun. Are you using streams so that you only work with small parts of the whole data continuously or attempting to do everything at the end?
Regards,
Rob Philpott.
|
|
|
|
|
Thanks for the Reply Rob
I am new to socket programming
I am trying send all the data in a single iteration.
I need to separate the data in to several segments to make sure the buffer is not full. but don't know how to do it.
|
|
|
|
|
Problem is caused by a recent windows patch. If you remove patch KB948609 the client side deserialization will except large datasets again. Or move to WCF as your transport method.
Read more at: EggHeadCafe[^]
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
Hello,
Assembly probing - how to instruct runtime to look under bin folder instead of GAC?
According to this article[^], runtime default behavior is to check GAC BEFORE other location.
So the fact that I added probing hint didn't change this (i.e. runtime is still binding to dll in GAC):
<br />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><br />
<probing privatePath="bin;bin\Debug;bin\Release;"/><br />
</assemblyBinding><br />
But this is NOT what I need, I actually need it to go bin folder for it?
This may be relevant.[^]
Also how can I check which version is being binded to? I launched "fuslogvw" but it is just sitting there. Nothing shows for some reason... it's giving me headache because (a) dll in GAC no debug information (even under DEBUG build)
(b) nHibernate mapping files loading - my mapping files are in bin folder, not in GAC
Thanks
dev
|
|
|
|
|
AppDomain.CurrentDomain.AssemblyLoad
and
AppDomain.CurrentDomain.AssemblyResolve
You may be able to write some code with those events to accomplish your goals.
|
|
|
|
|
sorry not exactly sure
you're saying i should implement event handlers to assembly loading/probing, set a breakpoint and see where it takes us?
I am suspecting perhaps it has to do with signing or that I've accidentally put one of System.Remoting.xxx dll into GAC (I ran a util which installed my dll's into GAC - which may have incorrectly installed System.Remoting.xxx into GAC ...)
so dead
dev
|
|
|
|
|
When the run time detects it is time to load an assembly it will call that method first allowing you to provide the assembly. You can then load whatever version you wish.
|
|
|
|
|
ah... ok...
i'm starting another test now though. Restore my monday backup and run the test cases again. If that works, it means I didn't screw up my GAC by installing any System.Remoting.XXXX there.
If no, then ...
awe... i cant think straight now all i can do is to watch test cases run after i restore backup my mind is just too fried.
dev
|
|
|
|
|
Especially on Thursdays is a long lunch :p
|
|
|
|
|
good stuff - just ran test cases against MON backup it's okay --- meaning:
(1) I lost up to MONDAY but not more
(2) My machine's GAC is *NOT* the problem
I will give my mind some rest before coming back next WED, then add back what i did last two days, bit by bit
Thanks for your advice though
dev
|
|
|
|
|
hey...
is this what you meant?
<br />
static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)<br />
<br />
43: {<br />
<br />
44: Debug.WriteLine(string.Format("CurrentDomain_AssemblyResolve reports that '{0}' was unresolved.", args.Name));<br />
<br />
45: <br />
<br />
46:
<br />
47: string[] parts = args.Name.Split(',');<br />
<br />
48: if (parts.Length > 0)<br />
<br />
49: {<br />
<br />
50: Assembly assembly = Assembly.LoadFrom(string.Format(@"{0}\{1}.dll", assemblyPath, parts[0].Trim()));<br />
<br />
51: return assembly;<br />
<br />
52: }<br />
<br />
53: <br />
<br />
54: return null;<br />
<br />
55: }<br />
<br />
56: <br />
Thanks!
http://blogs.conchango.com/markmann/archive/2008/09/01/loading-and-resolving-assemblies.aspx[^]
dev
|
|
|
|
|
oh this looks like it...
<br />
Assembly currentDomain_AssemblyResolve(object sender, ResolveEventArgs args)<br />
{<br />
<br />
Assembly MyAssembly, objExecutingAssemblies;<br />
string strTempAssmbPath = "";<br />
<br />
objExecutingAssemblies = Assembly.GetExecutingAssembly();<br />
AssemblyName[] arrReferencedAssmbNames = objExecutingAssemblies.GetReferencedAssemblies();<br />
<br />
foreach (AssemblyName strAssmbName in arrReferencedAssmbNames)<br />
{<br />
if (strAssmbName.FullName.Substring(0, strAssmbName.FullName.IndexOf(",")) == args.Name.Substring(0, args.Name.IndexOf(",")))<br />
{<br />
<strong>strTempAssmbPath = txtAssemblyDir.Text;</strong><br />
if (strTempAssmbPath.EndsWith("\\")) strTempAssmbPath += "\\";<br />
strTempAssmbPath += args.Name.Substring(0, args.Name.IndexOf(",")) + ".dll";<br />
break;<br />
}<br />
<br />
}<br />
MyAssembly = Assembly.LoadFrom(strTempAssmbPath);<br />
<br />
return MyAssembly;<br />
}<br />
http://www.chilkatsoft.com/p/p_502.asp[^]
Thanks for your hint
dev
|
|
|
|
|
Hi,
I am developing a application in which i need to get the list of installted programs on windows server 2003, from add or remove programs. I am using C#. any idea how to do it.
Currently I am having this code:
const string INSTALLED_SOFTWARE = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
string[] softwareInstalled;
try
{
regKey = Registry.LocalMachine.OpenSubKey(INSTALLED_SOFTWARE);
softwareInstalled = regKey.GetSubKeyNames();
regKey.Close();
}
From this I am getting complete program list. But I am looking for specifically add/ remove program list.
Thanks in advance,
Priyanka
|
|
|
|
|
Hi,
Read the following article[^], I think it will help.
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
Hey guys n gals
I am creating an app where there will be several 'steps' of which need to be completed before the final form is shown. Is there a way where we (I) could use one panel for each step and simply show and hide appropriate panels on the completion of a particular 'step', instead of creating a whole new form for each step?
I know how to do this but everytime I create more than one panel, the controls from one panel end up going onto the panel behind the top panel. I know a groupbox would work for this but they are ugly (atleast in this situation). I can't seem to find any info anywhere else that may suggest that there would be another way of doing this.
thank you,
jay
|
|
|
|
|
Create a UserControl for each step in the process and add/remove those from your main form.
|
|
|
|
|
Yay! Thank you Jimmanuel!
jay
|
|
|
|
|
See below, Jimanuel's suggestion is flawed to say the least.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|