|
Thanks for all the help!! ParseControl now works perfectly
|
|
|
|
|
Sorry one more question on jag arrays
how would i get the .Length of each dimension if they vary on the ammount of 'columns'
thanks heaps
|
|
|
|
|
Assuming test is your array and the data stored in the particular row you want is a string.
((string[]) test[myrow]).Length;
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
Hi,
is it possible to have a jaggard array of different datatypes on each row ?
|
|
|
|
|
I don't think so.. because you're declaring an array that holds arrays of a certian type. I think you're going to want an object or a struct. I'm guessing a stuct is going to be more suited to what you need.
Example..
using System;
class MyApp
{
static void Main() {
myStruct testVar = new myStruct();
testVar.intArray = new int[] {1,2,3};
testVar.strArray = new String[] {"One", "Two", "Three"};
Console.WriteLine("{0} - {1}", testVar.intArray[2], testVar.strArray[2]);
}
struct myStruct
{
public int[] intArray;
public string[] strArray;
};
}
structs are going to be faster than objects. But if you want to iterate through members, you should create an object that can be used with a "foreach" loop.
|
|
|
|
|
It is possible, there is on cavet though. If one of your datatypes is a ValueType (ie, you can't set it to null) an exception will be thrown when you do a foreach on the array.
object [] test = new object[2];
test[0] = new string[4];
test[1] = new Type[2];
int j;
for(j = 0; j < 4; j++)
{
((string[]) test[0])[j] = "moo" + j.ToString();
}
((Type[]) test[1])[0] = typeof(object);
((Type[]) test[1])[1] = typeof(System.Guid);
foreach(object [] t in test)
{
foreach( object i in t )
{
Console.Write("{0}, ", i);
}
Console.WriteLine("");
}
Console.ReadLine();
Sorry for the horrible formatting, the pre tag seems to be taking out all blank lines
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
Didn't even think about an object type.. thanks for pointing that out.
|
|
|
|
|
Thanks a bunch guys
|
|
|
|
|
I've been playing around with C# and I like it for some projects. What I've been playing around with lately is socket programming. It's simple enough to make a tcp or udp client/server environment. What I was thinking I'd try next is to emulate the "netstat" command. I'm just not sure how to go about capturing what's listening where. Any tutorials or hints on this?
|
|
|
|
|
I don't think there is a pure .NET way to do this. You'll have to use p/invoke and call into some system dlls (winsock2?) to get the information.
I don't have any experience with winsock to know where to look though.
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
How can I remove the title bar completely from a Windows forms application?
|
|
|
|
|
myform.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
This works on a form with default settings.
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
After installing the final verison of VS.NET, all the c# applicatins give an error and don't work and even compile. anyone ca help me?
|
|
|
|
|
none of your existing applications will work as they rely on earlier versions of the .NET runtime, but you should be able to at least compile them.
The only hitch I can think of off the top of my head is any .resx's having an older format (and version number).
Here's a link to the .NET team's upgrade page.
If you have any more problems please post more specific examples (compiler errors etc)
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
Hi James
Thanks a lot
It worked after using the tool to convert the .resx files
|
|
|
|
|
I wrote a windows service in c#, with the final version of .NET. I am able to start the service in just a fraction of a second. But when I copy the same service exe to a different machine (which also has the .NET final version) and try to start the service, it times out throwing Error 1053:. What could be the reason?
omkamal
|
|
|
|
|
Hello all,
I finally found out what the problem is. I am sharing my views with you.
"When you install a service and if your service's Account property is set to LocalSystem, then you need to have Administrator privilege (for the local system) to start the service. So if you have an NT user account and trying to start a service, make sure that you have local Admin privilege set to that NT user account on the machine that you are testing".
For further details on how to do it... send mails to me...
omkamal
|
|
|
|
|
In a PrintPage event I am opening a data reader and reading the records in a while loop. When I reach the MarginBounds I am setting e.HasMorePages to true followed by a return statement. When the next page attempts to print and the PrintPage event executes again it runs all of the code within the PrintPage method creating an error condition and does not just continue at the same place in the while loop. How is the process of printing a large number of records from a database usually handled?
Kyle
|
|
|
|
|
Pull the data into a DataSet, then use the DataSet while printing, keeping track of which records have been printed.
This is beneficial two fold, first you are closing your connection to the database sooner, and second you can make use of the DataSet elsewhere as well (Print Preview).
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
Hi,
Is it possible to have an array of Interfaces ?
This doesnt work
IInterface[] foobar = new IInterface[3];
So how would i go about it ?
|
|
|
|
|
It works fine on my RC1 machine.
namespace Test
{
public interface ITest
{
int GetTest();
}
public class EntryPoint
{
public static void Main()
{
ITest[] test = new ITest[3];
}
}
}
--
Peter Stephens
|
|
|
|
|
Does any one know how to check by code the public key on an assembly that I am loading.
- Tariq
|
|
|
|
|
This is untested code, but it follows the example shown at
ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemReflectionAssemblyNameClassGetPublicKeyTopic.htm .
using System.Reflection;
public byte[] GetPublicKey(string assemblyFilename)
{
AssemblyName assemblyName = AssemblyName.GetAssemblyName(assemblyFilename);
return assemblyName.GetPublicKey();
}
Sorry for the bad formatting, it appears that the pre tag isn't being very pre like
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
you are surely going to laugh ppl but i really don't know the answer of the question i'im going to ask you....what's C# ? I know logo,Basic,java,C,C++,pascal,fortran,... but C# ? I first thought it was some kind of sign to say C AND C++ but i realised by reading the board that it wasn't the case.... I really have never heard of that thing, could you light my little brain on that?
Or maybe a homepage about it....thx for the help,
Arnaud aka OptiKron
|
|
|
|
|
In short, C# is Microsoft's new language created specifically for the .NET platform.
Long(er) version: C# is Microsoft's new language created specifically for the .NET platform. The language constructs are very similar to Java, but being similar is a bad thing because I'm tired of seeing "but I could do X in Java!" On a lighter note the language (for me) is much better than VB.NET and is cleaner than all the baggage that C++ had to carry to support .NET.
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|