|
Hi ahmed,
I tried using List<ADUsers> list = ws.GetUserList().ToList();
This is the error I get now:
Cannot Implicitly convert type System.Collections.Generic.List < WindowsFormsApplication1.myService.ADUsers > to
System.Collections.Generic.List < WindowsFormsApplication.ADUsers >
|
|
|
|
|
somehow you're using an ADUsers class from two different namespaces. C# will see these as two different types (as indeed they are) even if they are identical in definition.
Make sure the declaration of
List<ADUsers> list
is using the same namespace as the one from
ws.GetUserList()
see your using statements for a clue.
Or try
List<WindowsFormApplication1.myService.ADUsers> list = ws.GetUserList().ToList();
do you understand?
"If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
|
|
|
|
|
The clue to the problem is in the error, and it's hard to spot at a glance. Basically though, you are trying to cast WindowsFormApplication.ADUsers to WindowsFormApplication1.ADUsers (I've highlighted the difference). In other words, you have 2 versions of ADUsers; one in WindowsFormApplication and one in WindowsFormApplication1, and they aren't the same class.
|
|
|
|
|
There is some application .exe and class library .dll.
Exe uses dll functions.
Is it possible inside dll code get exe assembly that calls its functions?
Чесноков
|
|
|
|
|
|
I need exe name, full path, version, architecture.
GetCallingAssembly and GetExecutingAssembly returns .dll one, not .exe
Чесноков
|
|
|
|
|
GetEntryAssembly?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
|
|
|
|
|
yes, thanks, I've just found that one also
Чесноков
|
|
|
|
|
How could i make a Multi-language installer in Visual Studio Deployment and Setup project?I want the installer to show the option to select the language, then the GUI of the installer will be changed to the selected language. Thanks
|
|
|
|
|
Wrong forum. Please try the Visual Studio forum.
|
|
|
|
|
Hi,
I'm trying to copy from lets say column "AC" to column "AA". The cell contains a formula which I have gotten and built an array out of the spreadsheet. Where I am stuck is how do you get the formula to update. IE: If the formula was =ROUND(AC25) when I copy it programatically to column AA, it still says =ROUND(AC25) instead of =ROUND(AA25).
I know I can use the replace command and do a string replacement, however if the formula is: =ROUND(A5+AB5) and is in column C, when I try to replace the A to a C, it becomes =ROUND(C5+CB5) instead of =ROUND(C5+AB5).
So my question is there a built in method into the Excel that I can call to perform the cell copy updating the formulas such as Excel does when you do it by hand?
Thank you,
Glenn
|
|
|
|
|
Hello Glenn,
Not sure if it will help, but most of the Excel problems I had, I solved by recording a macro while doing it in excel,
and then just transalte/adapt VBA to C#/Excel interop. Worked like a charm. It should work in your case too.
All the best,
Dan
|
|
|
|
|
Hi to all developers.
I try to program something like Yahoo messenger ( school project).
I write tow program, Server and Client. when a client request new account, server receive the command and made new user object but it won't add new user to database. in server every socket process within a thread.
I debug line by line, everything is OK ( I think ..! )
I also try update my DB via Stored procedure, but no luck
for more details take a look at my code.
any help appreciate.
User table:
http://i52.tinypic.com/2hyvskn.jpg
private void CommandReceived(object sender, CommandEventArgs e)
{
switch (e.Command.CommandType)
{
case CommandsType.NewUser:
{
int ret = CreateNewUser(e.Command.SenderUsername, e.Command.MetaData);
Command cmd = new Command(CommandsType.NewUser, "server", e.Command.SenderUsername, ret.ToString());
SendCommandToTarget(cmd);
UpdateConsole("new client registration ", "", IPAddress.None, 0);
break;
}
}
}
private int CreateNewUser(string u, string pne)
{
try
{
RMData db = new RMData();
string username = u;
string password = pne.Split(new char[] { ':' })[0];
string email = pne.Split(new char[] { ':' })[1];
Users user = db.Users.SingleOrDefault(usr => usr.Username == username);
if (user != null)
return 1;
user = db.Users.SingleOrDefault(usr => usr.Email == email);
if (user != null)
return 2;
user = new Users();
user.Username = username;
user.AddedDate = DateTime.Now;
user.Email = email;
user.Password = password;
db.Users.InsertOnSubmit(user);
return 0;
}
catch (Exception ex)
{
return 3;
}
}
whole project:
http://www.mediafire.com/?bf5e5d6lqoolbbs
Password is: 123
N
o
N
ame
modified on Tuesday, January 25, 2011 5:16 PM
|
|
|
|
|
Use all available information, and when that does not work for you, tell it in this thread. "Does not work" is not helpful.
Always give expectations and symptoms.
You should:
- add a try-catch in CommandReceived
- in each catch, log the entire Exception using Exception.ToString()
- watch for the line numbers in the exceptions and in your source editor windows.
NoName_ark wrote: catch (Exception ex)
{
return 3;
}
Don't swallow exceptions like that, you're throwing away valuable information.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
thanks for your reply.
I debug my code, there is no error in my code that try block catch it!.
I told everything is alright. the function return return zero ( no error)
I just can't step in to db context. actually debugger can't do it.
I will upload whole project, if there is no problem take a look at it, and debug only server side program.
U can put a check point in CammandReceived line.
In client side I just complete new user. Please try create new user form.
Very thanks for your time.
http://www.mediafire.com/?bf5e5d6lqoolbbs
Password is: 123
N
o
N
ame
|
|
|
|
|
No thanks, nobody is going to download and debug your project for you, it is your job. Now start by improving your code, give it better observability, and if any problems are left, ask specific questions here with sufficient detail.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Ok, thanks for your time.
I know My LINQ code have error.
I investigate it
N
o
N
ame
|
|
|
|
|
Hi
I found my problem.
I explain my answer to other people may have problem as same as me!
Actually I ( visual studio) make 2 DB file, first one is my solution folder,
and second one was in Bin/debug folder.
when I run or debug my program, data saved in bin/debug folder...!
but when I look at my DB by Visual Studio, it show Solution Database file that contain nothing.
I think it is a bug because I foolish myself for five days for nothing
N
o
N
ame
|
|
|
|
|
It's not a bug. What you have here is a limitation in your understanding of the build/run process in Visual Studio. If you look at your database in Solution Explorer, the properties have been set to Copy Always in the Copy to Output Folder dropdown.
|
|
|
|
|
I need some help. Would u guys mind helping me out on my new project? that's if your're not busy. Our project is somewhat similar to the one that has been submitted here in codeproject. Our project is about simulating a robot ball gatherer. The robot will gather the ball depending on the color and place it back inside a box that corresponds to the color of the ball. Obstacle avoidance is also present. And the robot's speed will gradually slow don until it reaches the ball. I would really appreciate if you will help me on this. I have been coding for 2 weeks already, and I can't even start the robot move. tsk. It's kinda hard especially for me as a second year student. Thank you very much in advance and hope I can hear from you soon.
thanks a lot.
|
|
|
|
|
The Coding4Fun[^] blog often features articles on building robots, using various techniques. Most of the articles are complete walkthroughs, and it's nice to have a material-list and an indication of the cost.
I are Troll
|
|
|
|
|
could u send us somelinks? ur blog is great but i can't find what im looking for.
|
|
|
|
|
Did you actually look at the link Eddy posted? It took me 2 seconds to find this[^].
I must get a clever new signature for 2011.
|
|
|
|
|
It's not "my" blog. No, it won't have an exact walkthrough of what you're looking for - but it might be a good starting point for your own research
I are Troll
|
|
|
|
|
Surprisingly, I have never had to do this before until now. I figured it would be a property of the column, but I am having difficulty determining how to do this. The GridView is populated at run time.
|
|
|
|