|
I mapped my local folder from remote server. now am trying to run applicaiton(EXE FILE) from mapped network drive (which is in remote server) it opens a window with two options run and cancel. when click run the window goes off. it is not displaying any error messages. where am going wrong.
am using framework 2.0 and c# winforms.
|
|
|
|
|
I guess it's a security issues. you try to start your app over network, which requires extended policies. you'll need to register your assembly in .net policies
|
|
|
|
|
am unable to understand your solution. Can you explain in detail? start appl over network, what this mean?
if I open the application, it is running in local and remote system. after mapping only am getting problem. it is not showing any error message. simply window goes off.
|
|
|
|
|
How to convert the following code written in VB.Net to C#.Net?
Private P As New Collection
Thanks.
|
|
|
|
|
VBA.Collection p = new VBA.Collection()
.. or use a more specified type of collection, like ArrayList
|
|
|
|
|
I have created a window project with the name winProject and it's database is in sql server 2005 the name is winDatabase
Now i want to create a setup that installs the project(winProject)
and it's database(winDatabase)
Please reply me
|
|
|
|
|
Take a look at WiX[^] that has the ability to install SQL databases.
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|
|
Is there a way to test if the cast will work before actually doing the cast? My app will spend a lot of time testing for valid casts and many times the cast won't be valid so I want to avoid the overhead of catching the InvalidCastException.
TIA
|
|
|
|
|
Use is keyword.
if(yourObject is SomeType)
. Or use as keyword
obj = yourObject as SomeType;
if(obj != null)
|
|
|
|
|
Single and Int32 are non nullable value types so can't be used with 'is' and 'as'
|
|
|
|
|
Ohh I haven't noticed the single and int32 in the title. I am sorry.
|
|
|
|
|
Why would casting from a single to an int not be valid, is there something you're not telling us?
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Errr, yes, I am telling you my example was stupid
Basically is there a way when casting between value types to work out if a cast will work without testing it and catching Invalidcast or Overflow?
|
|
|
|
|
I don't think there is...
I reckon the best you can do is check the float isn't too big, too small, ot is NaN. You could write up a little method:
public bool ConvertSingleToInt(float Single, out int Integer)
{
Integer = 0;
if(Single > int.MaxValue || Single < int.MinValue || float.IsNaN(Single) ) )
return false;
Integer = (int)Single;
return true;
}
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
I am coming to the same conclusion, thanks for your help. I am actually considering just going down the exception catching route - if its slow when a cast is invalid or overflows then it's a great indicator that those casts shouldn't be attempted in the first place.
|
|
|
|
|
Have you looked at the Int32Converter class and its CanConvertFrom method? There are xxxConverter classes for all the integral data types I believe.
Dave
|
|
|
|
|
I have looked at those but they don't seem to take into account the data in the variable being cast, just if a converter exists or not.
|
|
|
|
|
Int32.TryParse would be the way to go I think.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
That only accepts a string
|
|
|
|
|
Int32 intval;
Single s = 88;
Int32.TryParse(s.ToString(), out intval);
Job Done.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I know but these casts could be executed 100s of millions of times - I don't want to take the hit of converting everything to a string first.
|
|
|
|
|
Fair enough, but I bet its quicker perfoming than writing a function to see if it can be done. I would probably go with one of the earlier suggestions, put it in a try catch - unless you are expecting millions to fail?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
That's what I have decided to do - just use exceptions. I don't expect many of them to fail but the casting forms part of a simple domain specific language so some users could try to do lots of ridiculous casts. Still... sod 'em - ridiculous things will run ridiculously slowly
|
|
|
|
|
Hello everyone,
Suppose my C# application is pure managed code (C#), for such types of application, CLSCompliantAttribute should be always true?
Are there any other points to be considered to consider whether or not it is complaint?
http://msdn.microsoft.com/en-us/ms182156.aspx
thanks in advance,
George
|
|
|
|
|
Hi, I am getting the compile error and cannot see why it is wrong. I am learning C# so I am pretty new to this. Here is the code I am trying to compile
using System;
using System.Windows.Forms;
namespace MyForm
{
public class MyForm : Form
{
private TextBox txtEnter;
private Label lblDisplay;
private Button btnOk;
public MyForm ()
{
this.txtEnter = new TextBox();
this.lblDisplay = new Label();
this.btnOk = new Button();
this.Text = "My HelloWin App!";
// txtEnter
this.txtEnter.Location = new System.Drawing.Point(16, 32);
this.txtEnter.Size = new System.Drawing.Size(264, 20);
//lblDisplay
this.lblDisplay.Location = new System.Drawing.Point(16, 72);
this.lblDisplay.Size = new System.Drawing.Size(264, 20);
//btnOk
this.btnOk.Location = new System.Drawing.Point(88, 224);
this.btnOk.Text = "OK";
this.btnOk.Click += new System.EventHandler(this.btnOK_Click);
//MyForm
this.Controls.AddRange(new Control[] { this.txtEnter, this.lblDisplay, this.btnOk});
}
static void Main ()
{
Application.Run(new MyForm());
}
private void btnOk_Click(object sender, System.EventArgs e)
{
lblDisplay.Text = txtEnter.Text + "\n" + lblDisplay.Text;
}
}
}
But I am getting error The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?) (CS0234)
Any help is greatly appreciated. Thanks
|
|
|
|