|
I tried to compile source c# files from inside code as follows:
...
string[] filesArray;//array of c# files full path
CodeDomProvider codeProvider = CodeDomProvider.CreateProvider("c#");
CompilerParameters parameters;
...
CompilerResults results = codeProvider.CompileAssemblyFromFile(parameters, filesArray);
Compiler reported error: Line number 0, Error Number: CS2032, 'Character '\v ' is not allowed on the command-line or in response files;
I have red that c# compiler doesn't accept characters from 0 to 31 in ascii table plus '|' character.
I didn't manage to remove those characters from source files.
What should i do?
Mile
|
|
|
|
|
Hello,
I have two servers at different locations and I want to match the timestamps generated by one server.
I have an Idea of generating timestamp for GMT 0, this means that timestap will be same across all servers. How can I generate this timestamp? any idea?
Pavas
|
|
|
|
|
DateTime.ToUniversalTime()
only two letters away from being an asset
|
|
|
|
|
I guess it will work...
Thanks a lot
Pavas
|
|
|
|
|
hi guys,
I have this sql query:
string commandtext = "select Res_nr from AfwTarieven where Res_nr='"+resid+"'";
now i want that if he find a Res_nr that is equal to resid, do something:
{}
bud if there is no Res_nr that is equal to my resid, then do somthing else.
How can i write that in code? i had something like this , bud i got a error:
mycomm = new SqlCommand(commandtext, myconn);
int a = Convert.ToInt32(mycomm.ExecuteScalar());
if(a.ToString() == null)
{
MessageBox.Show("no Res id found");
}
else{
MessageBox.Show(a.ToString());
}
can someboddy help me ? thanx
|
|
|
|
|
Why didn't you post the error message, don't you think that would be the quickest way to fix the problem?
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
I have a couple of thoughts here - the first being that you shouldn't use commandtext here. Use a Stored Procedure so that you don't end up opening your app up to s SQL Injection attack. Secondly, if you are going to return a Scalar, use
SELECT (COUNT(1)) FROM AfwTarieven WHERE Res_nr = @Res_Nr in your stored procedure. If it returns 0, then it isn't present - anything else and it is.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete Oihanlon,
Thank u , great help
|
|
|
|
|
You're welcome.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
my program is working fine everywhere except one vista home premium client pc.
there it shows "NullReferenceException : object reference not set to ..................."
if any one can give some clue where could be the problem or any information if required from me?
the relevant code is below:
cLock = new ClsHasp();
bLock = cLock.gfCheckLock();
cLock is class variable of my FrmMain and is an object of class ClsHasp, and contains a function public bool gfCheckLock(), bLock is obviously bool type.
error is in second line only 1 of several client pcs.
thanking you in anticipation.
manoj sharma
09313603665
manoj.great@yahoo.com
|
|
|
|
|
Check the method gfCheckLock() there might be a variable/object in there that gives the error.
Or it might just be in the constructor of the ClsHasp if there are objects/variables creates/initialized in there.
good luck.
V.
If I don't see you in this world, I'll see you in the next one... And don't be late. (Jimi Hendrix)
|
|
|
|
|
class ClsHasp
{
private int seed; private int lptNum; private int passw1; private int passw2;
public ClsHasp()
{
seed = 0; lptNum = 0; passw1 = 0; passw2 = 0;
}
public bool gfCheckLock()
{
try
{
System.Windows.Forms.MessageBox.Show("1");
===============
i m trying above in gfCheckLock(), even before any statement i m displaying a message, then also the same exception??
any ideas??
manoj sharma
09313603665
manoj.great@yahoo.com
|
|
|
|
|
Could be, not so long ago I had the same problem and tried to debug with messageboxes, they never showed either, but still the code was further down the line, so yes.
Comment out all lines in gfCheckLock and do a return true .
V.
No hurries, no worries
|
|
|
|
|
thanx.
i tried the same. this time its working(how?) but need to do the stuff inside.
manoj sharma
09313603665
manoj.great@yahoo.com
|
|
|
|
|
So check the code that you replaced, the bug is in there somewhere.
|
|
|
|
|
as u can see above very first line of message doesn't get displayed. so what could b wrong?
manoj sharma
09313603665
manoj.great@yahoo.com
|
|
|
|
|
How the hell should I know?
Somewhere in the code you just replaced some variable or object hasn't been initialized...
If you want help, please be more specific, I can't tell what you're doing if you don't elaborate on it more. I didn't develop that piece of code you know. I suggest you try to do some debugging or something.
|
|
|
|
|
please dont don't get it wrong? code is not giving problem everywhere?? it is running fine everywhere else.
but on 1 pc only this is the error. so i guess it's not related to code but something other than that. that's why i need experts viewes.
to start debugging on that client machine (i cant use debugger as no source code is there no vs2k5 is there) i m creating exe here, sending it client and then i came to know the results. that's why i m giving message. return true suggested by you works, but instead first line of messagebox doesn't come up only that single machine.
hope this cools you down. any ideas??
manoj sharma
09313603665
manoj.great@yahoo.com
|
|
|
|
|
Dude, It's not a question of cooling down or not, I can't help you without information.
What's the contents of that specific function? It could be that it's machine related, like an unregistered dll, a setting, a missing file, etc, but it could be code. Can you write to a log file? Put some lines in the function and see what it does. You could also try to add beeps if all else fails.
|
|
|
|
|
What's happening in gfCheckLock()? If it's a null reference exception you're probably not instantiating something. Does the app call an external resource that the single client machine doesn't have perhaps? Are the other machines also running the same OS?
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson
|
|
|
|
|
class ClsHasp
{
private int seed; private int lptNum; private int passw1; private int passw2;
public ClsHasp()
{
seed = 0; lptNum = 0; passw1 = 0; passw2 = 0;
}
public bool gfCheckLock()
{
try
{
System.Windows.Forms.MessageBox.Show("1");
===============
i m trying above in gfCheckLock(), even before any statement i m displaying a message, then also the same exception?? any ideas??
as for the OS develop machine is win2k3, clients are xp as well as vista.
manoj sharma
09313603665
manoj.great@yahoo.com
|
|
|
|
|
Hi,
Currently i am able to hit to the proxy server by supplying username and password after getting 407 response from proxy server. The server is configure with authName =private which i get as Basic realm in the server response. The config file contains:
# Proxy directive - asks for authentication when access a URL through proxy
<proxy *="">
Order deny,allow
Allow from all
AuthType Basic
AuthName "Password Required"
AuthName private
AuthUserFile "C:\Apache2\passwd\passwds"
Require user user
Require user valid-user
And i am setting the credential and getting the resonse from the server as:
Uri proxy_url = new Uri("http://146.122.190.237:8080/");
proxy.Address = proxy_url;
proxy.Credentials = new NetworkCredential("user","pass","private");
httpWRequest.Proxy = proxy;
//get the response. This is where we make the connection to the server
httpWResponse = (HttpWebResponse)httpWRequest.GetResponse();
If i havent supplied "private" it is working fine, but if private is supplied it is again fire 407 "AuthenticationRequired" error.
Can you tell me how to pass this realm value through credential in C#.Net, if at all needed to pass?
Is the domain means the realm ? if yes why it is failing?
Here i am using basic authentication type.
Thanks in advance.
Thanks,
Sangram.
Bend of the road is not end of the road
|
|
|
|
|
i think you are good to go without Realm
Bend of the road is not end of the road
|
|
|
|
|
Are there any possibilities to convert directly from DateTime object to a format like this:
"2007-10-01T14:44:59.5663649+02:00"
??
Thanks...
|
|
|
|
|
Take a look at the DateTime.ToString[^] overload that allows you to specify the format.
From a quick scan of that page I think the one you want is ToString("O");
|
|
|
|