|
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
|
|
|
|
|
You can find details documentations in MSDN library.
|
|
|
|
|
sunilTVL wrote: i would like to know about delegates
can any one provide documentation
How about Google[^]?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
I am using EnterPrise Library 3.0 April 2007 application block.
I want to create a day wise Log file
but it will create only single file with name trace.log and when ever day changes the Log content is adding but I need day wise logfile.Could any one assist?
Thanks.
|
|
|
|
|
hi, i need your suggestion on how to do data binding to display a table consisting of data that is obtained from xml file. The table is created using listbox and should have the structure as shown below:
_____________________________
|aaaaaaaaaaa|_________1______|
|___________|_________2______|
|bbbbbbbbbbb|________3_______|
|___________|_________4______|
May i know how should i write my xaml codes?
Thanks.
|
|
|
|
|
In my XML, for every node one optional attribute is there.
I am trying to find that, specific node has that optional attribute or not at runtime but there are some issues
Please help me on this
Thanks in advance
Praveenkumar Palla
|
|
|
|
|
What are the issues? You can't expect to get help if you don't identify the problem.
|
|
|
|
|
my xml is like this
<laser lasername="newlaser" modelname="Nufern v1.0" serialno="1" manufacturername="Nufern v1.0.0.0" maximumpower="200" ip="192.168.1.173">
<tabular>
<property id="1" name="System Id" prgbar="false" selected="false" min="0" max="30" pwd="true" units="Sec" gauge="false">
<property id="10" name="Startup delay" prgbar="false" selected="false" min="0" max="30" units="Sec" gauge="false">
In the above xml there two child nodes for node "tabular" . In that one node has "pwd" attribute and another one don't have, it is optional one.
So I want to know that for the specific node the attribute is there or not at runtime----I tried like this
XmlDocument xmldoc2 = new XmlDocument();
xmldoc2.LoadXml(objXmlTasks.decrypt());
XmlNodeList xmlchildnodelst = xmldoc2.SelectNodes("/lasers/laser [@LaserName='" + laseridval + "']/properties/tabular/property[@name='" + childLaserSelectedName + "']");
Password= xmlchildnodelst[0].Attributes.GetNamedItem("pwd").Value;
But there is now pwd attribute for second one so exception
"object reference null"
PraveenKumar Palla
|
|
|
|