|
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
|
|
|
|
|
It's something of a cross between Java and C++.
It is built on Microsoft's Common Language Runtime (CLR) (and so is VB.NET) which gives it Just In Time compiled characteristics. It is garbage collected, so you don't have to worry about long running programs fragmenting memory. Every type can be converted to an object (the universal base class) though it supports true value types as well (through a process called boxing). It supports multi threading. Array bounds and Null references are always checked. It is impossible to reinterpret_cast any object reference. The only casting analogs are static_casts which can be implicit and dynamic_casts which must be explicit.
Now Visual C++ 7 and Visual Basic 7 both target the CLR, so why would you want to learn C#? The answer is that while VB7 and VC++7 support the CLR, they do so in a backwards compatible way. In VB, you must remember to define all method parameters as ByVal because that performs the best in the CLR, but the default is ByRef which was the original VB behavior. In C++ (I'm not quite as familier with C++ CLR code) you must use many nasty looking prefixes such as __managed.
C# on the other hand was designed from the ground up to support the CLR. This means that all the syntactical default values are the same as the CLR defaults. Method parameters are always passed by value unless you use the 'ref' or 'out' keywords. The syntax is similar to C++ but IMHO cleaner in some areas.
One feature that ppl want that is not present in the current version is templates. There are rumors that generic programming might be present in V2 of C# though.
Bottom line: If you need to do web programming or business programming, C# is reliable and performs well too (or at least has good features for scaling across servers). If you need to write a high performance game or a ray tracer, you will probably be better off using C++.
--
Peter Stephens
|
|
|
|
|
Peter Stephens wrote:
If you need to write a high performance game or a ray tracer, you will probably be better off using C++.
While I whole-heartedly agree with this statement, I must say I'm anxious for DirectX 9 to come out. DX 9 is supposed to include a managed interface, but thats all I remember on the topic.
Maybe DX9 will allow a full-fledged game to be possible under .NET, then again maybe not
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
|
|
|
|
|
thx for the answer!
I'm not in the business programming/web programming yet( in 3 years when i have finished university ). So I don't think I'll have a great use of it. I'll stick to C++ for the moment. I've actually discovered .NET just after i posted this message. It seems interesting but coming from microsoft....i'm have some doubts. Well, I should maybe try it to see what the new baby is capable of.
|
|
|
|
|
It never hurts to expand your skill set, one thing I liked to do was take problems given in uni and try to work them into my programming.
In my Introduction to Error Correcting Codes class I wrote a program in C# to find the coset leaders for a given problem (64 possible cosets i had to find 63 vectors in the set, 256 or 512 vectors total).
Good Luck,
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,
I’m trying to use wndProc for ListView in C#.
LRESULT CALLBACK MainWndProc( HWND hWnd,
UINT uMessage,
WPARAM wParam,
LPARAM lParam)
{
switch (uMessage)
{
case WM_NOTIFY:
ListViewNotify(hWnd, lParam)
}
}
LRESULT ListViewNotify(HWND hWnd, LPARAM lParam)
{
//Any idea how can I write following code in C#.
//C Code is
LPNMHDR lpnmh = (LPNMHDR) lParam; // Translate in C#???????
}
Any help on this would be great.
|
|
|
|
|
Is there a way to have one connection string, in this case an OleDbConnection to an Access database, that can be accessed globally from more than one class? Is it possible to have one connection string that covers an entire application? Thanks for any help.
Kyle
|
|
|
|
|
I use a static method to retrieve my database connection:
using System;
using System.Data.SqlClient;
namespace DbUtils {
public class DataTools
{
public static String username = null;
public static String password = null;
public static SqlConnection GetConnection()
{
String connection = "database=mydb; network address=myserver; network library=dbnmpntw; "
if(username != null)
connection += "user id=\"" + username + "\"; ";
if(password != null)
connection += "password=\"" + password + "\"; ";
return new SqlConnection(connection);
}
}
}
And then elsewhere in your app you just get a connection like:
SqlConnection conn = DbUtils.DataTools.GetConnection();
--
Peter Stephens
|
|
|
|
|
That really helps me! Thank you. Kyle
|
|
|
|
|
I have a windows service application. but I installed the latest version of .NET framework (they call the "FINAL VERSION") on a different machine and try to install this service (created in an older version, not very old though, one with came along with VS.NET beta 2).
The installutil says that it is not able to recognize the installers. Isnt this nuts? Why do they change the way it works? Is there any documentation on this, how the installer works in the final version? Can someone help me on this?
omkamal
|
|
|
|
|
You'll have to recompile your code with the final version (1.0) of the SDK (all 120 MB of it). Before you can use it on a 1.0 machine.
Versions after 1.0 should have to problem handling 1.0 code however (so you won't go through this again when 2.0 comes out).
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
|
|
|
|
|
Upon first pass it appears as thought the dotnet framework is no longer embedded and automatically deployed with VS.NET microsoft installer deployment projects as it was in Release Candidate 1. I was hoping not to have the user have to run the dotnetfx.exe redistributable separately before they could install the .NET application I have written.
When I compile a deployment project I get the warning: "This setup does not contain the .NET Framework which must be installed on the target machine by running dotnetfx.exe before this setup will install. You can find dotnetfx.exe on the Visual Studio .NET 'Windows Components Update' media. Dotnetfx can be redistributed with your setup."
Does any know a way to have the dotnetfx.exe automatically run when a new .NET application is being installed? Any ideas on other options?
Kyle
|
|
|
|
|
Thomas Scheidegger had this to say about it on the DOTNET mailing list.
MS did a last-minute change in deployment strategy!<br />
<br />
.NET Framework Deployment Guide:<br />
<br />
<a href="http://msdn.microsoft.com/library/en-us/dnnetdep/html/dotnetframedepguid.asp" target="_blank">http:
<br />
and in special for VS.NET and .msm:<br />
<br />
<a href="http://msdn.microsoft.com/library/en-us/dnnetdep/html/vsredistdeploy.asp" target="_blank">http:
<br />
the solution seems to be a 'Bootstrapper' hack.....<br />
<br />
<br />
Thomas
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
|
|
|
|