|
I'm confused. You now appear to have 3 definitions for a Customer object. You should only have one throughout your entire solution.
You should be using only the customer object in the class library. You need to remove the definitions of Customer in the Services and use the Customer class in the class library instead. You can add the class library as a reference to each project that needs it. You can do that by right-clicking the project and selecting "Add Reference..." and going to the projects tab and choosing the class library project that contains the Customer class.
|
|
|
|
|
Hey i am doing as you are telling only. There are no multiple copies of the class. It is there in the common project(separate class library). But when you use the class by adding reference to the services then the wsdl of each and every service since it is in a different namespace will consider the same class as two different class files.
Srivatsan
|
|
|
|
|
Hi..
I m developing a C# compiler for which i have a utility package.
That package has lots of funtions.
i want to call those functions without an object. and i don't want
those functions to be static.
how can i achieve this..
plz help me.
regards,
nas
|
|
|
|
|
why you want to cancel the (static) option ??
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
becaus i want to call the function directly
as:-
.....
func1();
.....
and not as:-
.....
className.func1();
.....
as we cal function in C..
|
|
|
|
|
maybe iam wrong, but i don't think that is possible.
if you wrote a function on a class A and you want to access it
from another class B then you cannot access it regardless class A.
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
anyway thanx for reply..
i hav another doubt..
i want to include a file, similarly as of #include.
only i want to copy the code at the position where i call the function IncludeFile().
|
|
|
|
|
could you be more specific, i didn't understand the new question..
nasambur wrote: only i want to copy the code at the position where i call the function IncludeFile().
this is not a professional way to do it , suppose you that you will
use that code again, what will happen ?? you will copy the code again ??
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
hmm. u r right..
i dont know exactly what happens behind when we use the 'using' in C#.
plz explain me..
|
|
|
|
|
please Rewrite your question in order to understand your problem.
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Actually, we are developing an application to test the User Load for any Website..
below is the script of our tool that loads virtual user and tests the site..
using System;
using RTGWebLoad;
namespace Coolgoose
{
public class Transaction
{
private string username;
private string password;
public void TransactionMain(RTGHttpBrowser wlHttp, string ThreadNum, long RoundNum, long MaxRounds)
{
wlHttp.BeginTransaction("Coolgoose_SendingMail");
CallCoolGooseSendMail(wlHttp, ThreadNum, RoundNum, MaxRounds);
wlHttp.EndTransaction("Coolgoose_SendingMail");
}
public void CallCoolGooseSendMail(RTGHttpBrowser wlHttp, string ThreadNum, long RoundNum, long MaxRounds)
{
if (RoundNum == 1)
CGLogin(wlHttp);
CGSM(wlHttp);
}
public void CGLogin(RTGHttpBrowser wlHttp)
{
string[] loginData = wlHttp.GetData("http://10.80.4.43/?get=userpass", ',');
username = loginData[0];
password = loginData[1];
wlHttp.Get("http://www.cooltoad.com");
wlHttp.InfoMessage("Page1: " + wlHttp.wlSource);
wlHttp.Get("http://www.cooltoad.com/go/email");
wlHttp.Get("http://www.cooltoad.com/account/login.php?mail=1");
wlHttp.ContentType = "application/x-www-form-urlencoded";
wlHttp.FormData("ACCOUNT", username);
wlHttp.FormData("PASSWORD", password);
wlHttp.Post("http://www.cooltoad.com/account/login.php?mail=1");
wlHttp.Get("http://www.cooltoad.com/common/header_email.php");
wlHttp.Get("http://as03.cooltoad.com/go/desktop?p=folders");
wlHttp.Get("http://as03.cooltoad.com/go/desktop?o=folder:inbox");
wlHttp.InfoMessage("------" + username + " logged IN ------");
}
public void CGSM(RTGHttpBrowser wlHttp)
{
wlHttp.Get("http://as03.cooltoad.com/go/desktop?c=new");
string sCompose = wlHttp.FindString(wlHttp.wlSource, "COMPOSE\" VALUE=\"", "\">");
wlHttp.ContentType = "multipart/form-data";
wlHttp.FormData("TO", "xyz@gmail.com");
wlHttp.FormData("CC", "");
wlHttp.FormData("SUBJECT", "Testing LTT -- Naveed");
wlHttp.FormData("ATTACHMENT_DATA.wlFile-Name", "");
wlHttp.FormData("ATTACHMENT_DATA.wlContent-Type", "application/octet-stream");
wlHttp.FormData("MESSAGE", "Testing LoadTestingTool");
wlHttp.FormData("TZO", "-330");
wlHttp.FormData("C:SEND:::NEW.x", "12");
wlHttp.FormData("C:SEND:::NEW.y", "9");
wlHttp.FormData("COMPOSE", sCompose);
wlHttp.Post("http://as03.cooltoad.com/go/desktop");
wlHttp.InfoMessage("Compose: " + sCompose + " --- " + username);
}
public void CGLogout(RTGHttpBrowser wlHttp)
{
wlHttp.Get("http://as03.cooltoad.com/go/desktop?c=logout");
wlHttp.ClearCookies();
wlHttp.InfoMessage("------" + username + " logged OUT ------");
}
}
}
after writing this script we wil pass this to our Testing tool, which compiles this C# script and starts the run.
we want to tune our code, so that we can write this script in more better way..
currently the InfoMessage() functions are in the same package RTGWebLoad..
we want to move it to another package and can be called without an object or class name..
one of my mate suggest me to include the package's code as we do in C (using #include).
regards,
nas
|
|
|
|
|
Your mate is thinking the wrong way for C#.
You can wrap this code in to a class library of its own. Then you can reference the class library from where it is needed, if it is needed in multiple projects.
|
|
|
|
|
nasambur wrote: i dont know exactly what happens behind when we use the 'using' in C#.
plz explain me..
Using can be used in two places. In the context of this conversation you mean the way using is used as a directive to import namespaces into the current code file.
Using allows the developer to call the class name on its own rather than be forced to use its full name. e.g.
using System.Data.SqlClient;
...
SqlConnection connection = new SqlConnection();
or
System.Data.SqlClient.SqlConnection = new System.Data.SqlClient.SqlConnection();
|
|
|
|
|
|
nasambur wrote: i want to include a file, similarly as of #include.
C# has no need of that funtionality.
If you want to be able to use classes, structs, etc. from other namespaces without having to refer to it fully each time use add the appropriate using directive at the top of the class file.
You may also have to add a reference to the appropriate assembly that contains the code. To do this, right-click on the project you wish to add the reference to and select "Add Reference...". The dialog contains various tabs that indicate where the assemby is.
|
|
|
|
|
Sorry, but what is the big deal about calling ClassName.Func1() ?
It is better to package these functions up in to an appropriate set of classes. It provides better logical separation.
|
|
|
|
|
Hi
Can anybody helpme out to get the grasph control where we can draw multiple plots in the same graph.
Regards,
Rocky.
|
|
|
|
|
|
Hi All,
I need to display time in the following format:
7:40a (not AM/PM whole word just A/P in lowercase)
So how could I achieve this?
|
|
|
|
|
I think
string strDT = <datetime instance="">.value.toShortDateTimeString().Replace("AM","a").Replace("PM","p");
It can be a bad way but it's a simple way
|
|
|
|
|
Thanks buddy,
it is working fine.
|
|
|
|
|
Hi,
I have already used the Camtasia SW, but the file that create is very bulky, therefore I like to find some coding for .NET compatible SW.
I have found another SW called TerboDemo(7.5 trial version), which captures the screen as an array of screenshots, which also take big capacity. It saves in .tdp format.
Please help me to find a .NET cording.
Thanks and Regards
khema
|
|
|
|
|
Hi
I have created a datagrid and i have bound that datagrid with the result from the query. I have a table of purchase which i have bound with the datagrid. But now i want that whenever a person clicks anyof the row of purchase it must display the purchase details in the form of table or grid.
How can i do that?
Please hlep me
KHATRI
|
|
|
|
|
Hi you.
You are saying about hierachical data, called master-detail data. You can completely do it.
First, you make a dataset contains two table: PURCHASE and PURCHASEDETAIL. And you also make an internal relation among two tables with a "PURCHASE.ID = PURCHASEDTAIL.pID" datarelation. See next.
Second, you assign Datagrid's Datasource into this dataset.
That's all. It is working like you want .
Hope my help.
|
|
|
|
|
Yes but how it will show in datagrd.. i mean how ill gonna implement that..
like First i m calling a Purchase table in a dataset and bounding it.
Then on click it will request for the details of the table for the particular purchase id. The result will be shown in another datagrid showing heirarchial or master child relation.
KHATRI
|
|
|
|