|
plz help me applicaton form in c#.net and loginform
|
|
|
|
|
I'd start with my answer to the last inane question you posted. Clickety[^]
|
|
|
|
|
I have a .NET service that collects data from custom hardware.
I want clients to log on to the service so I can do the Publisher-Listener pattern to publish updated data to the clients.
Right now I have remoting objects that both sides use that are basically event containers. Server gets new data, server gets listener objects from listener collection, server transmits new data via the event to the client. Client observes event, unpacks and updates. Is this the best way to do this?
The way it's laid out now seems hackish just to have classes that are nothing more than event containers. I also need additional scaffolding on both sides to observe the events and client request calls. The system is safety critical and the prototype application leaves a bad taste in my mouth.
Does anyone have a different approach other than the event container, or should I get some mouthwash (or some bourbon) for the bad taste?
Scott P
"Simplicity carried to the extreme becomes elegance."
-Jon Franklin
|
|
|
|
|
hi everyone out there, am trying to make a simple sound player with atleast forward(next), rewind, pause, play and stop. can anyone give me help on this? I will really appreciate anything manageable.
thanks.....
|
|
|
|
|
if you just want to play WAV's then you can check out this article[^] from our very own codeproject.
|
|
|
|
|
si = new ServiceControllerInfo(new ServiceController("myservice"));
si.Controller.Start();
si.Controller.WaitForStatus(ServiceControllerStatus.Running);
|
|
|
|
|
Hi,
there could be many reasons why starting a service fails, e.g. your code is in an aspx page; or you don't have the necessary privileges (are you running as admin? is this Vista?); does the service exist, and is its status "Stopped"?
etc.
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text output (not TextBoxes), and PictureBoxes for pictures (not drawings).
modified on Friday, June 10, 2011 12:22 PM
|
|
|
|
|
yes i have checked all of the conditios, i van start and the service through administrative tools of the windows, but not through code!
my account is administrator and the windows is vista!
|
|
|
|
|
-------------------------------------A.W.Surveys----------------------------------
Hey Guyz,
wanna earn 100$ in 7 days......free to join
Here I am going to give you the link of that site which
will make you to earn 100$ in just 7 to 10 days.....with very ease.........
What you have to do is that visit that site and signup there and there are few earning opportunities ........you just have to fill them out............It will make you to earn 30$ in a single day............
http://www.AWSurveys.com/HomeMain.cfm?RefID=purshottam
A new opportunity is waiting for you .......Don't miss it..........
thanxs for ur support...its nice to see u all working tough
http://www.AWSurveys.com/HomeMain.cfm?RefID=purshottam
---------------------------------CBclickbank--------------------------------------
Hi,
I joined CBclickbank.com affiliate program. I like this program very much. CBclickbank.com free affiliate program where you can earn $161,452.38 just by refering Your friends! Click on the link and join I want to recommend you. Please visit this link.
http://cbclickbank.com/affiliate/?r=purshottam
----------------------------------Shareapic----------------------------------------
upload any pictures and make money online
http://www.shareapic.net/ref.php?owner=purshottam
|
|
|
|
|
Die in a deep hole. F*** your referrals you prick.
|
|
|
|
|
I have never used reflection before and I have been tasked with a project to tranform object data into 1 long string for a mainframe. I am trying to use an xml document as a reference for the information need to tranform to the mainframe. Below is an example of 1 element of that XML. What I am trying to accomplish is read in the schema and use reflection to build a string. Below the XML I have what I think is correct, but can not seem to get it working. Any point in the right direction would be great. businessType always comes back null and I can't seem to get the value
<MainframeField>
<MainframeKeyword>POLNO</MainframeKeyword>
<MainframeKeywordDescription>Policy Number</MainframeKeywordDescription>
<BusinessEntityDetails>
<Namespace></Namespace>
<EntityName>HealthPlanDetails</EntityName>
<PropertyName>PolicyNumber</PropertyName>
</BusinessEntityDetails>
<MaximumLength>2</MaximumLength>
<DataType>STRING</DataType>
<IsRequired>TRUE</IsRequired>
<TransformationDetails>
<MainframeTransformationEntity></MainframeTransformationEntity>
<Namespace></Namespace>
<MethodToCall></MethodToCall>
<Inputs>
<Input></Input>
<Input></Input>
</Inputs>
</TransformationDetails>
</MainframeField>
Part of my problem is I am not sure how to set the applicationEntity.HealthPlanDetails equal to the object created using reflection to get back the value.
Code:
public static string BuildMainframeString(ApplicationEntity applicationEntity)
{
XDocument xmlMainframeOutput = XDocument.Load(@"C:\_XsdGen\Gen\Mainframexml.xml");
var mainframeOutputs = from mainframeField in xmlMainframeOutput.Descendants("MainframeField")
let mainframeKeyword = mainframeField.Element("MainframeKeyword")
let mainframeKeywordDescription = mainframeField.Element("MainframeKeywordDescription")
let businessEntityProperty = mainframeField.Element("BusinessEntityProperty")
let maximumLength = mainframeField.Element("MaximumLength")
let dataType = mainframeField.Element("DataType")
let isRequired = mainframeField.Element("IsRequired")
let businessEntityDetails = mainframeField.Element("BusinessEntityDetails")
let businessEntityNamespace = businessEntityDetails.Element("Namespace")
let businessEntityName = businessEntityDetails.Element("EntityName")
let businessEntityPropertyName = businessEntityDetails.Element("PropertyName")
let mainframeTransformationDetails = mainframeField.Element("TransformationDetails")
let mainframeTransformationEntity = mainframeTransformationDetails.Element("MainframeTransformationEntity")
let mainframeTransformationNamespace = mainframeTransformationDetails.Element("Namespace")
let mainframeTransformationEntityMethodToCall = mainframeTransformationDetails.Element("MethodToCall")
let inputs = mainframeTransformationDetails.Descendants("Input")
select new
{
MainframeKeyword = mainframeKeyword.Value,
MainframeKeywordDescription = mainframeKeywordDescription.Value,
BusinessEntityNamespace = businessEntityNamespace.Value,
BusinessEntityName = businessEntityName.Value,
BuisnessEntityPropertyName = businessEntityPropertyName.Value,
MaximumLength = maximumLength.Value,
DataType = dataType.Value,
IsRequired = isRequired.Value,
MainframeTransformationEntity = mainframeTransformationEntity.Value,
MainframeTransformationNamespace = mainframeTransformationNamespace.Value,
MainframeTransformationMethodToCall = mainframeTransformationEntityMethodToCall.Value,
Inputs = (from input in inputs
select input.Value).ToList<string>()
};
StringBuilder mainframeOutputString = new StringBuilder();
foreach (var mainframeField in mainframeOutputs)
{
string businessEntityName = mainframeField.BusinessEntityName;
string businessEntityNamespace = mainframeField.BusinessEntityNamespace;
string businessEntityPropertyName = mainframeField.BuisnessEntityPropertyName;
string mainframeTransformationEntityName = mainframeField.MainframeTransformationEntity;
string mainframeTransformationMethodToCall = mainframeField.MainframeTransformationMethodToCall;
if (businessEntityName.Length > 0)
{
Type businessType = Type.GetType(BUSINESS_ENTITY_CLASS_PATH + businessEntityName);
PropertyInfo pi = businessType.GetType().GetProperty(businessEntityPropertyName);
mainframeOutputString.Append(mainframeField.MainframeKeyword);
mainframeOutputString.Append("=");
mainframeOutputString.Append(pi.GetValue(businessType, null));
mainframeOutputString.Append(";");
}
else
{
Type mainframeType = Type.GetType(MAINFRAME_TRANFORMATION_CLASS_PATH + mainframeTransformationEntityName);
MethodInfo mi = mainframeType.GetMethod(mainframeTransformationMethodToCall);
mainframeOutputString.Append(mainframeField.MainframeKeyword);
mainframeOutputString.Append("=");
mainframeOutputString.Append(mi.Invoke(mainframeType, null));
mainframeOutputString.Append(";");
}
}
|
|
|
|
|
Why are you trying to use reflection to do this? It seems like this would be much easier using a simple XmlReader (or XmlDocument and XPath) and a StringBuilder object.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Scott,
I was trying to avoid having to write a unique method for every mainframe keyword. Maybe I should clarify. I am writing a web service which takes in a large xml structure that represents an application. Then I parse that out into business entities that I can manipulate. Once that is done, I need to take my objects and create the long string. I don't want to have to create a method for each keyword that points to the businessEntity and the correct property each time. Maybe reflection isn't the correct path, but I am not sure how to build the output dynamically because it can be any number of object types. Hope this makes sense, if you can suggest a better route I can look into that as well.
Thanks,
|
|
|
|
|
|
Speaking purely from memory, you understand. (I'm not near my dev machine) My recollection is that you just set the forms' region to be a region you create in the shape you want. No need for transparency.
Henry Minute
If you open a can of worms, any viable solution *MUST* involve a larger can.
|
|
|
|
|
Evening All,
A quick question on Data grid views. I want to be able to format the row depending on the dataset that is returned to me. e.g. 1 = red 2 = green 3 = purple.
This is for a winform application.
Thanks in advance
Michael
|
|
|
|
|
What is the question?
Have you tried anything at all? Do you just expect code?
|
|
|
|
|
I have tried to look at the formatting of cells but want to change the background displaced based on the data that in datatable that will be used as the data source for the datagrid view.
|
|
|
|
|
|
Hi all,
We have to create one datarow to insert a row in the data table.
but here i have to insert row by row dynamically(one by one row) in to the datatable,
but how to do that, am i need to create that much of datarow to insert the number of rows??
waiting for your reply
|
|
|
|
|
listen,
do you have some kind of database?
if you create a datatable and add some rows in runtime mode, when you quit the application all data will be lost you know?
Create a database; sql server (or xml) code your way to the database and edit and display data in C# application.
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
hi mr nelson,
thanks for your reply,
but the thing here is i am not going to do anything with that data, i have to spool the data's in the datatable and at once i will print that in the report, i dont need to save that one.
so can you please tell me how to load rows(data's) dynamically in the datatable
??
waiting for reply
|
|
|
|
|
Try googling on something like 'load data into datatable c#'
work through the hits till you find something you like, then try to do it.
IF you get stuck, after you have written some code, then come back with a specific problem. With code snippets so that we can see what it is you are doing.
What is this! Homework'R'Us?
Henry Minute
If you open a can of worms, any viable solution *MUST* involve a larger can.
|
|
|
|
|
drop the mr,
like in runtime? type create datatable in runtime in google, i always dont remember codes.
but data will be lost after the application quit.
add crystareportview to project, a crystal report, a dataset scheme.
read before making that. you have some things to do first...
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
There are two ways to initialize members in a C# class, via constructor:
class MyClass
{
private int Member;
public MyClass()
{
Member = 0;
}
} or through member initialization:
class MyClass
{
private int Member = 0;
} My question: Are there problems / benefits of one approach vs. another?
From what I can see, it's a wash if you only have a default constructor. If you have multiple constructors, member initialization is preferable for those members that are set to the same value by all constructors.
Software Zen: delete this;
|
|
|
|