|
Any links that i can start with especially that i need to save into several files once i fill the main form. Another question is that when i fill all fields with data how can i export/save them to several files without entering to each file alone
thanks
|
|
|
|
|
In windows application, i want ot access one method which on the from.cs, then how i can access that method in class without creating new intance of form in c#.
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|
|
If you want to access a method without instantiating something beforehand, you need to make that method static:
public class FunkyForm : Form
{
public static void DoSomething()
{
}
} This is called using FunkyForm.DoSomething();
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
in this static function i want to fill one list control. how i can access list control in static method.
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|
|
If it's a member of the class, you can't. That's how static methods work. If it's not a member, pass it in.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
If you want to fill the listbox, then you need an instantiated version of the form. You could (and I stress could because it's not really the best way) expose the listbox in the form. A better approach would be to have the static handler interact with the form via events so that the form is responsible for updating the listbox by responding to events.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I am developing windows application, in that on from i have listbox, and one statice method. i want to acess that listbox in static method then how i can?
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|
|
Please don't ask the same thing twice.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Asking twice eh? Don't know if you have an answer but, you can make the listbox static, and reference it with MainForm.myListBox (or whatever you class / listbox is called) but then you'd never be able to access the listbox with this. which is kinda annoying.
Or you could pass the listbox as a variable, im pretty sure that would work, but im not certain.
public static void Stuff(ListBox listbox) {<br />
listbox.Items.Add("I like pie");<br />
}<br />
<br />
...<br />
<br />
Stuff(this.listBox1);<br />
...
Oh, i get it now you, aksed an incredibly similar question in the topic above, but with a different title. Anyway...
|
|
|
|
|
Sorting number in access database...
My question is:
In database access I have a table named Persons.
First field in this table,called PersonID, is Number, long int, not
Autonumber. Then I put some data in this table
with C# Windows application, for exapmle:
PersonID: Name
1 Jonh
2 Jack
3 Maria
4 George
5 Alex
6 Peter
7 Mike
8 David
and my application, should delete some
of the Names from database, and the problem is here!
Imagine, I should delete records:2(Jack), 4(George), 6(Peter)
and then my table in database look like this:
PersonID: Name
1 Jonh
3 Maria
5 Alex
7 Mike
8 David
My question is:
Is there a way, PersonID field who is number(long int)
to have value like this(and table):
PersonID: Name
1 Jonh
2 Maria
3 Alex
4 Mike
5 David
So when I delete some records, from table,
I want
the field (number - long int) to sort himself
in order: 1,2,3,4,5....
not: 1,4,5,6,9....
because in my c# windows application I need sorted records
1,2,3,4,5...
thank you c# lover's.
kpp
|
|
|
|
|
Well, you can get it to renumber stuff to ensure that there are no gaps, but this is increadible wasteful of resources. I wouldn't bother with it. It will also break any referencial integrity so you'd have to fix that up also. All that turns a simple delete into a really expensive operation.
KppsK wrote: because in my c# windows application I need sorted records
1,2,3,4,5...
The records are sorted. They just have gaps. What exactly do you need this for anyway.
|
|
|
|
|
You should just keep the gaps, if you where listing out all the entries and you didn't want to see gaps just count the records as you write them out.
So if you where using a for loop to get each record:
for(int i=0; i < totalRecords; i++) {<br />
}
For anything else just create another int, set it to 0, then everytime you print out a record increase it by one.
If any of this message makes no sense at all, then i do appologise, but im very tired.
|
|
|
|
|
The Undefeated wrote: WTF? You see that right ^ its missing parts. But when i go to edit, the whole line is there.
Think about how it would be rendered as HTML. Replace the < with <
|
|
|
|
|
hi all,
i want to write a directshow filter in c#... and i m new to the technology...
can anyone please provide me basic guidelines (or links) so that i can start from the scratch...
thanks...
Kuldeep
|
|
|
|
|
|
I need to enumerate members of Administrators group on all computers remotely.
I should be able to specify computername, username & password. Has WMI got any class to enumerate group membership ?
Also, has WinNT provider got capability to connect to remote machines with alternate credentials?
Any code will be of great help. Thanks in anticiaptions.
h.
before c# there was darkness
|
|
|
|
|
Hello. I've actually recently written a program to manage user groups on remote servers, including add an expiration date/time when that user will be removed. I'll be posting an article on it soon. Here is some code that should help you out. You will need to add a reference to System.DirectoryServices, and using statements for System.DirectoryServices and System.Collections:
<br />
String entryString = "WinNT://" + computerName + ",computer";<br />
DirectoryEntry dirEntry = new DirectoryEntry(entryString, username, password);<br />
<br />
foreach (DirectoryEntry entry in dirEntry.Children)<br />
{<br />
if (entry.SchemaClassName.Equals("group", StringComparison.CurrentCultureIgnoreCase))<br />
{<br />
if (entry.Name.Equals("Administrators"))<br />
{<br />
object members = entry.Invoke("Members", null);<br />
<br />
foreach (object member in (IEnumerable)members)<br />
{<br />
DirectoryEntry memberEntry = new DirectoryEntry(member);<br />
String name = memberEntry.Name;<br />
String path = memberEntry.Path;<br />
MessageBox.Show(path + "\n" + name + "\n" + memberEntry.SchemaClassName);<br />
}<br />
}<br />
}<br />
}<br />
|
|
|
|
|
Hello there,
The problem is that I need to connect with alternate credentials. All my servers have different password.
WinNT provider by default uses pass-through authentication, which means takes your currently logged on priviledges to connect to remote computer. This works good if I have common password as I login using same passowrd. But that is very risky, a malicious code can then play aroumd.
I am also trying to find out way to connect using alternate credentials, If you get to know first please post it
By the way, there's option in directory entry class to specify user/password but in that case the output is blank, not sure why.
Good day.
h.
before c# there was darkness
|
|
|
|
|
Hi,
What is Thick Client Application? Is it possible to create a Thick Client
Application using .Net . Please refer some sample application
With Regards,
Sakthi.
|
|
|
|
|
This[^] article is a good source of information - and is easily found by google. Just google on "wikipedia thick client". A good example of a thick (fat) client would be Microsoft Word.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Basically there are two ways to do this,
Push (server pushes data to the client) and Pull (client sends a request and recives a response. HTTP is pull)
To implement a Push based system, you have 2 choices. Sockets (TCP/IP networking) and .Net Remoting.
A client server system using TCP/IP will need a custom server built using C#. This can run as a Windows service or as a standalone application. The server component cannot be built usiing ASP .Net. This gives you more control over the data and the server controls the update frequency. However, you will have to implement your own data protocol.
http://msdn2.microsoft.com/en-us/library/d3s1ybx2(vs.71).aspx
The advantage here is that you can achieve better performance, because you have more control over the client and the server. However, this depends a lot on your design and implementation. (Bad design== bad performance)
Remoting uses .Net objects. Clients can call objects on the server, and the server can call client methods. Compared to TCP/IP networking this gives you much less performance, but much more easier to implement. I haven't used remoting much to give an accurate description.
http://msdn2.microsoft.com/en-us/library/kwdt6w2k(vs.71).aspx
A Pull based system is similar to HTTP. The client makes a web request and recieves a response to it. This is done by using ASP .Net and .Net webservices. This gives you the automatic performance benefits of ASP .net like caching and the fact that your web server handles the connections more efficiently than your own custom server.
It will also be easy to scale out when using a web server. I've built web applications that handle upwards of 5000 clients making requests every 10 seconds.
Hope this helps...
SSK.
|
|
|
|
|
Hi Mr.SSK and Mr.Peti,
Thanks for your reply .
Can you give me a simple application illustrating Thick client.
Regards
Sakthi
|
|
|
|
|
What? How does this describe a thick (fat) client?
Does this sound like Microsoft Excel or Word to you? A fat client performs the bulk of processing on the client. That's it. It's not a difficult concept, and doesn't rely on push/pull architectures at all.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
i would like to know about delegates
can any one provide documentation
Sunil Tvl
|
|
|
|
|
ya can go throug codeprojects.com
Sunil Tvl
|
|
|
|