|
hi,
I developed a web servcie.Now iam using that in windows applications.I have given anonymous access inIIS.even though iam getting the following error
System.Web.Services.Protocols.SoapException: Server was unable to process request. System.UnauthorizedAccessException: Access to the path
|
|
|
|
|
The server is probably denying access to the a file which you're trying to read in the service. See if running it in debug mode (the web service) provides more details as to where in the code for the service the request is being denied.
|
|
|
|
|
hi friends
first can i install mssql server 2000 on linux server????
can i connect and use ms sql server 2000 from windows application(C#) ??
i have application with c# and database with ms sql server 2000 . but manager of this project said me that i have to use linux server instead of current windows server... please guide me to solve this problem.
thank you
nobody help you...
you have to help you yourself
and this is success way.
|
|
|
|
|
mssql server cannot be installed on Linux.
If your manager insists to use Linux, you should use cross platform database like MySQL.
|
|
|
|
|
As the previous poster said, use MySQL. They have a .Net connector you can download from their site, install it and add a reference to your project and it's easy from there. No problems connecting to Linux/MySQL from a windows app (C#).
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
mr.mohsen wrote: can i install mssql server 2000 on linux server?
No.
mr.mohsen wrote: can i connect and use ms sql server 2000 from windows application(C#) ?
Yes, look at www.connectionstrings.com[^]
mr.mohsen wrote: manager of this project said me that i have to use linux server instead of current windows server...
Manager is a moron, and needs to be fired. Obviously he doesn't know squat. Unless he means MySQL which is much different than MSSQL Server.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hi all,
I want to apply the logical and operator on 2 string, or 2 binary, or 2 number
there is an error (cannot apply & / && on string .....)...\
please how can i solve this problem???
thanks all
|
|
|
|
|
What is the logical meaning of : "abc" && "xyz" ?
|
|
|
|
|
u can use &(logical and) on ineteger and binary values but not on string values
for example u have 2 values 1(0001) and 5(0101) then u use & operator . the result of this operation is 1(0001).
nobody help you...
you have to help you yourself
and this is success way.
|
|
|
|
|
Create your own class or struct and use operator overloading. The code below should get you started. The logical && operator cannot be overloaded but it is evaluated using the binary operator & which can.
using System;
namespace MyApp
{
public struct MyString :
IComparable, IComparable<MyString>,
IEquatable<MyString>
{
private string m_Value;
public MyString(string value)
{
m_Value = value;
}
public static implicit operator MyString(string value)
{
return new MyString(value);
}
public static implicit operator string(MyString value)
{
return value.m_Value;
}
public static MyString operator &(MyString myStringA, MyString myStringB)
{
MyString rtn = new MyString();
return rtn;
}
public override string ToString()
{
return m_Value;
}
public int CompareTo(object value)
{
int rtn = -1;
if (value is MyString)
{
MyString compareToValue = (MyString)value;
rtn = CompareTo(compareToValue);
}
return rtn;
}
public int CompareTo(MyString value)
{
return m_Value.CompareTo(value.m_Value);
}
public bool Equals(MyString obj)
{
return Equals(obj);
}
}
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
The only way that you could do it is through some code like the following:
byte[] str1Bytes = Encoding.UTF8.GetBytes("abc");
byte[] str2Bytes = Encoding.UTF8.GetBytes("xyz");
if (str1Bytes.Length != str2Bytes.Length)
throw new ArgumentOutOfRangeException("two strings must be the same length");
for (int i = 0; i < str1Bytes.Length; i++)
str1Bytes[i] = (byte)(str1Bytes[i] & str2Bytes[i]);
string resultString = Encoding.UTF8.GetString(str1Bytes); Of course you can change the code so that it deals with uneven strings but that was the simplest case.
|
|
|
|
|
In my project, client program checks for updated program in our local server (LAN). However, server is open to user, only by login. If the user is not logged in, he is not getting the updated version of my programme. Some users not at all logging the server.
How I can make c sharp program to download, without logging the server or sending user name and password to the server for accessing the update file.
Please help me, thanks in advance
|
|
|
|
|
What protocol are you using to connect to the server to check for downloads? Usually you can provide a NetworkCrediential object which contains the username and password for the server to verify.
|
|
|
|
|
I have disposed the Button named "b" but I can still access it's properties. how is it possible like its names?
private void Form3_Load(object sender, EventArgs e)
{
b = new Button();
b.Text = "Button1";
b.Size = new Size(50, 50);
Controls.Add(b);
Button bb = new Button();
bb.Text = "Button2";
bb.Size=new Size (100, 100);
bb.Click += new EventHandler(bb_Click);
Controls.Add(bb);
}
void bb_Click(object sender, EventArgs e)
{
Controls.Remove(b);
b.Dispose();
GC.SuppressFinalize(b);
GC.Collect();
if (b.IsDisposed ==true)
{
MessageBox.Show("disposed"+b.Text);
}
else
{
MessageBox.Show("not disposed");
}
|
|
|
|
|
Disposing is meant to clean up any unmanaged resources that the button uses, so for example custom paint brushes using normal WinAPI methods as opposed to System.Drawing . brushes. Usually what people do since they can't "recover" from Disposing of an object is they set it to null so that any accidental or unintentional code which uses the disposed object throws a NullReferenceException rather than work some times or not at all or works in peculiar ways.
|
|
|
|
|
If disposing of an object deals with unmanaged resources then it means object is not set free until we explicitly set it to null. What if I am done using 100 Button objects wouldn't they perserve their space in memory. Please clear me in my understanding of objects life cycle after disposing.
Thanks for answering
|
|
|
|
|
If I remember correctly then it's not safe to do anything with an object after it's been disposed because the Garbage Collector may free it up (make it null essentially) at any point.
netJP12L wrote: What if I am done using 100 Button objects wouldn't they perserve their space in memory
Set them to null after you've disposed of them:
aButton.Dispose();
aButton = null;
That'll make sure you don't access them accidentally, the GC will free them up as and when it needs space.
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|
|
On Windows when you press the start button (lower left corner) one of the entries that comes up is "my music." Part of this folders name includes the user name. For example in the following path "C:/Documents and Settings/john smith/My Documents/My Music" john smith is the user name. Since this part of the name will vary from user to user how can I open this folder on different computers with the same program?
Jason
|
|
|
|
|
you should to use dynamic USERNAME instead of john smith.
then you have to determine the USER NAME of current user programmatically.
its too easy. just search in google.
nobody help you...
you have to help you yourself
and this is success way.
|
|
|
|
|
You're going to be treading in "murky" waters because on Vista the whole naming convention has changed. For example "My Documents" is now called "Documents" and is located:
"C:\Users\USERNAME\Documents" rather than "C:\Documents and Settings\USERNAME\My Documents" The Desktop:
"C:\Users\USERNAME\Desktop" rather than "C:\Documents and Settings\USERNAME\Desktop"
|
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
will return a string with the full path of the current user's My Music folder
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Dave is right,
For all those special folders you may be interested in, use Environment.GetFolderPath()
and Environment.SpecialFolder enumeration
They keep moving these things around from one Windows version to the next, so it really is the
only way to make it portable.
|
|
|
|
|
I have a struct:
public struct IITObjectPersistentID
{
public int highID;
public int lowID;
public IITObjectPersistentID(int HighID, int LowID)
{
highID = HighID;
lowID = LowID;
}
public override string ToString()
{
return "{" + highID.ToString() + "." + lowID.ToString() + "}";
}
}
I have overridden ToString(), but I want to be able to specify the normal ToString() arguments. Ie, I want to be able to get the hex display of the numbers, too, like:
IITObjectPersistentID OPIDx = new IITObjectPersistentID(25,50);
string displayAsHex = OPIDx.ToString("X");
How can I write conditional code in the override statement that lets me pass arguments to OPIDx.ToString() ?
|
|
|
|
|
You don't. You just overload ToString by writing a new ToString method that takes the argument. Just as int does.
public string
ToString
(
string Format
)
{
return "{" + highID.ToString ( Format ) + "." + lowID.ToString ( Format ) + "}" ;
}
|
|
|
|
|
I'm sorry, your code confuses me. Are you saying I just need to remove the "override" portion of my method?
|
|
|
|