 |
|

|
Bad example. That one does do what you siad, but it was written as an ad-hoc example to demonstrate the new Pipe classes. It's NOT meant as a tutorial on how to use the classes in production.
That example actually comes straight from the MSDN documentation, which uses very simplistic examples on using specific classes. That example, and many many more in MSDN, is by no means the definitive source on how to properly implement a server using pipes.
An implementation that would look closer to a real-world example is this[^].
|
|
|
|

|
Hi to all,
How can i communicate between Siemens PLC and Visual C# via USB PPI cable as serial communication? When i plug it to my pc so it is identified as a HID device. i want it as com port.(serial pot). how can i achieve this? must i attach any kind of dll to my project? Anyone can help me?
|
|
|
|

|
The driver for the device has to expose the device as a COM port. If it doesn't, you're going to have to go to the manufacturer of the device and either get an updated driver that does this or get a SDK for the device that allows some other method of communication.
|
|
|
|
|

|
I have three text boxes A,B,C.if i enter numeric values in A & B text boxes then i should get product of those values in third Text box automatically . Please tell me the solution and code in C# as soon as possible..
REGARDS
Ameeruddin Syed
|
|
|
|

|
if you are looking at doing this automatically I would have a look at the leave event of the textboxes.
Textbox.Leave[^] event further reading.
you will need to write on of these for both textboxes, and on leave I would check to make sure that the value is a number before performing the addition of the 2 values.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|

|
Message from Member 9550558:
Please i want complete code as per my question
Sorry I have told you in a descriptive way how to do it, in the link I also gave you it had an example of how to use the event, but I am not going to write it for you! I will however help you debug the solution if you have trouble.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|

|
This is one of the reasons I have email disabled.
|
|
|
|
|

|
If you're expecting someone to do your homework for you, you're going to be very disappointed. Class work is where YOU do the work to show that you are learning the concepts presented.
|
|
|
|

|
hello everyone
i want to build a simple metro app private diary using c# please help me guys... i want to give simple calender to the user so that user can pick date and he can go through with editing his stuff.. after he should be able to retrive the content by clicking on particular date. How can i go through please share your vies
|
|
|
|

|
Use the MonthCalendar control. Subscribe to the DateChanged event. When the date is changed, read the content from whatever data storage method you decide to use, be it XML or whatever.
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|

|
During my implementation for a client/server application I encountered the follwing problem:
Let's say we have a client application C which is the remoting client and that connect to a Server application S which is the remoting server.
C has two NICs which are both activated.
The problem is when both cards are activated, the client application C is having a hard time establishing a connection with the remoting server S. It seems that the client cannot detect what card to use. Whenever we disable one card, Everything works fine.
Some sites adviced to configure the "bind to" attribute but it does not work.
Note that when running both application on the same machine, no problem occurs. This occurs only when the client and server application are run in different machines.
Does anyone know how to correct this?
Thanks in advance.
|
|
|
|

|
I'm guessing it works on local machine, because it goes direct on looback (127.0.0.1).
I think what you need (not sure) is to add a route. This way you'll be telling whenever I'm connecting to S, use specific gateway.
google "adding route multiple nic"[^]
hope it helps
|
|
|
|

|
Thank you for your feedback. This solution may work but it will not be the best approach. The thing is that we cannot oblige the end users to configure that since that it may affect other applications.
I think that this should be handled in the application level and so on it will be transparent to the user.
Any idea about how to make that configured in .Net Remoting?
|
|
|
|

|
Again, I'm not sure about all this:
- but I think this is a pure low level windows setting/config. Routes have to be configured/added like IP, gateway, mask, mac, etc of both network cards. I don't think this is a per-application domain (but don't hold my word to it).
- there probably is a way to add a route from your .net program, but it probably requires administrative privileges (instead of configuring it manually).
- I think "other applications" are already using a route that is configured right
btw Why are they using dual nic? I'm curious on what is the use case.
|
|
|
|
|

|
Can anyone suggest any good books or tutorials on WPF-MVVM please? I am looking for latest books or tutorials... not the old or outdated ones... Books or tutorials with hands-on or practical examples... Thanks.
|
|
|
|
|
|

|
Alright, I'll admit, after days of looking at this code I'm a bit at my wits end. At a high level it's a project that uses a client server architecture to deliver a stream object via wcf for large data transfers. The blog and project I've utilized can be found here:
http://blogs.msdn.com/b/webapps/archive/2012/09/06/custom-wcf-streaming.aspx[^]
My issue is this, the project works incredibly well with numeric values. But, if I add a few basic string values in, it'll process say 30 rows of data and then die, with the following message:
"The input stream is not a valid binary format. The starting contents (in bytes) are: 08-02-00-00-00-0A-00-00-00-0A-00-00-00-0A-00-00-00 ...
A summarized version of the code looks like this:
Server:
model.ID = i;
model.ParameterOne = i;
model.ParameterTwo = i;
model.ParameterThree = i;
model.AMP = stringCache[i - 1];
formatter.Serialize(memStream, model);
Client:
OrderModel m;
while (s.CanRead)
{
m = formatter.Deserialize(s) as OrderModel;
count++;
Console.Write(string.Format("order ID is {0}\r\n", m.ID));
}
I've run through multiple scenarios. I thought the wcf client was either timing out or being overloaded, but I can run it without wcf all in the same class and run into the same exact issue. I can also manually read and write to a memory stream not utilizing the server class and it works perfectly fine, so that proves it can't be encoding or issues with that data in general.
You can download the same project here (just three classes):
https://skydrive.live.com/redir.aspx?cid=8df0b4ca8325874a&page=self&resid=8DF0B4CA8325874A%21175&parid=8DF0B4CA8325874A%21110&authkey=%21&Bpub=SDX.SkyDrive&Bsrc=Share[^]
If you go to class DBRowStream and comment line 179, it works beautifully. If you uncomment it, it fails after 30 rows. My best guess is that the overriden read method of the class is killing the stream prematurely, but if that were the case, why would a few extra string values mean the difference between it working and not.
I apologize for the novel, and any suggestions or help would be so greatly appreciated!
Thanks so much,
Ryan
|
|
|
|

|
It's multithreaded; could it be that the memorystream is corrupted before the thread finishes?
|
|
|
|

|
You know I was wondering the same thing. Although it's odd that it makes it through exactly 30 rows every single time before it errors out. I was also thinking that because the author switches the memory stream from one of two other memory streams, that maybe the main memory stream is being overridden before a read is complete....
|
|
|
|

|
formatter.Deserialize(s) assumes that the entire object has been successfully written to the stream? For grins and giggle, try writing the entire stream to memory after 30 rows; I bet a dime to a dollar, all of your strings have not been completely written. At least that is what I would look into, don't know the answer myself as I completely avoid WCF like the plague.
|
|
|
|

|
Hi, I am trying to access a MS Access database using Windows form. I added my connection string in App.congig file.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<clear/>
<add name="Constr" providerName="System.Data.OleDb"
connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Users\\XXXX\\Documents\\YYYYY.accdb; Persist Security Info=False;"/>
</connectionStrings>
</configuration>
Code I added in my code to read this is
string connectionstring = ConfigurationManager.ConnectionStrings["Constr"].ConnectionString;
but I am getting following error on this line.
System.NullReferenceException was unhandled
Message=Object reference not set to an instance of an object.
Source=LoadTrackingTool.
I am not getting why I am getting this error. Can anyone please help me out in this. I am new in this functionality.
Thnx,
Aduu
|
|
|
|

|
Stack Traces do help!
put it there please!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
modified 12-Nov-12 1:17am.
|
|
|
|

|
You'll have to step through the code and find what line of code causes the error. At a quick glance I don't think it is failing on getting the connection string.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|

|
have you tried
string connectionString = ConfigurationManager.ConnectionStrings["Constr"].ToString();
Simon
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|

|
hi
i build my Webservice on FrameWork 3.5 (C# Visual studio 2008)
it work excellent on Windows-7 and XP - and it work excellent if i run Through Visual-Studio.
i try to run on Windows-8 and i got error.
1. i try to setup the Application pool IIS on .NET v2.0 Classic
2. i try to check the .NET framework 3.5 (include .net 2 and 3) on Windows features on/off
the error:
Detailed Error Information:
Module StaticFileModule
Notification ExecuteRequestHandler
Handler StaticFile
Error Code 0x80070032
Requested URL http://localhost:80/WS_TEST_SETUP/Service1.asmx
Physical Path C:\inetpub\wwwroot\WS_TEST_SETUP\Service1.asmx
Logon Method Anonymous
Logon User
Anonymous
Before I go back to Windows-7 what i can do ?
|
|
|
|
|

|
hello
is what is possible when one selects one word in a textbox, every similar word will be displayed in a MessageBox.Show.
The principle is to retrieve those similar words and the user can see.
thank you
|
|
|
|

|
Of course it's possible! The problem is how do YOU define "similar". Once you have that, YOU have to write the code to get the currently selected text in the textbox, then search the textbox contents for the "similar" works.
|
|
|
|

|
can you help me in this code ?
|
|
|
|

|
Nope. I've got my own pile of code to write and I'm not getting paid to write yours too.
You first need to define exactly what you mean by "similar" and then probably do some research on "Regular Expressions".
|
|
|
|

|
When I try to serialize an object using xmlserializer,It is throwing out of memory exception.Is there any way to serialize large objects like more than 30 mb. I am able to serialize an object to xml file only if the size of the file after serialization is around 15 mb otherwise outofmemory exception is thrown
modified 11-Nov-12 2:53am.
|
|
|
|

|
We got an article[^] on the subject. Unless you'd really need it as XML, I'd also recommend using the BinaryFormatter.
|
|
|
|

|
Hi all, can someone please clear things up for me regarding inheriting an abstract class. According to msdn.com[^] the following are some of the features of an abstract class:
It is not possible to modify an abstract class with the sealed modifier, which means that the class cannot be inherited.
A non-abstract class derived from an abstract class must include actual implementations of all inherited abstract methods and accessors.
The first sentence says that the class cannot be inherited but the second sentence says you can have a non-abstract class which is derived from an abstract class. If I'm not mistaken, a derived class is a class that inherits from another class. Thanks in advance for your response.
modified 10-Nov-12 17:16pm.
|
|
|
|

|
ASPnoob wrote: with the sealed modifier
You missed this in your understanding, sealed means, well sealed!
Never underestimate the power of human stupidity
RAH
|
|
|
|

|
MSDN isn't always right and sometimes, like here, they don't update the documentation. If you follow the 'other versions' links, at the top of that page, to VS 2012, you'll see that the stuff about 'abstract sealed' has been changed.
It's possible that the person who wrote the docs was confusing C# and intermediate language (IL) classes. When a C# static class is compiled to IL, the class declaration is marked as abstract and sealed. So a C# static class is equivalent to an IL abstract sealed class.
In C# it's not actually possible to declare a class as 'abstract sealed'. Try it and you'll find that it won't compile.
Alan.
|
|
|
|

|
Thank you all for responding. I guess the confusion was over the fact that the author of the article was not being very clear.
|
|
|
|

|
I agree that this sentence could be clearer. What they're trying to say is:
- You cannot add the
sealed modifier to an abstract class;
- The
sealed modifier means that a class cannot be inherited;
It looks like they cleared this up in the VS2010 version[^], where the sentence has been changed to:
It is not possible to modify an abstract class with the sealed (C# Reference) modifier because the two modifers have opposite meanings. The sealed modifier prevents a class from being inherited and the abstract modifier requires a class to be inherited.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|

|
In a C# 2008 application, I used linq to sql to connect to a sql server 2008 database. Now I want to obtain the connection of the database from the
app.config file instead of hardcoding the value into the application. I want to be able to change the connection string to the database since I will be moving this application from unit testing database to user acceptance database to the the prodction database.
Right now I am getting the error message, ""Object reference not set to an instance of an object." I know this error message is coming from the line of code that I listed below since it is the only line of code I changed.
The following is a snippet of the code from the *.designer.cs file (this is part of the dbml file).
using System.Configuration;
public esampleDataContext() :
base(ConfigurationManager.ConnectionStrings["sample.Properties.Settings.DEVConnectionString"].ConnectionString,mappingSource)
**Note: base(global::sample.Properties.Settings.Default.DEVConnectionString, mappingSource) is the line of code that I replaced that was generated by the
.net framework
I want to mention the following:
1. The *.dbml file is associated with a particular project file.
2. The connection string settings for this *.dbml file are the following:
a. DEVConnectionString (settings)
b. Connection String = Data Source=dev1;Initial Catalog=DEV_test;Integrated Security=True
c. application settings=True
d. settings property name is DEVConnectionString.
3. The project file that has the *.dbml file. has a reference set to the system.configuration.
**Note: This code in similar applications that I wrote, but I do not why it does not work here.
Thus can you tell me, show me in code, and/or point me to a reference that I can use so I can obtain the value in the app.config file for the database connection string I want to use. I do not want to use a hard-coded connection string to the database.
|
|
|
|

|
rachel_m wrote: point me to a reference that I can use so I can obtain the value in the app.config file for the database connection string I want to use. I do not want to use a hard-coded connection string to the database.
Correct me if I'm wrong, but isn't the connectionstring in the app.config file? Isn't the app.config file an XML file that can be edited?
If both answers are yes, then your connectionstring isn't hardcoded, but loaded from the settings-file.
|
|
|
|

|
The problem is the settings-file does not get the value from the app.config file. The values are retained in the settings-file from the time I orginally created the app.config file. The settings-file needs to change at some point.
|
|
|
|

|
rachel_m wrote: ConfigurationManager.ConnectionStrings
Your app.config needs to be set up in a very specific way for that to work.
If it isn't set up that way then ConnectionStrings will be null.
I would suggest that you do the following
1. Create a project/app that ONLY gets the connection string
2. Create a app.config that ONLY has that connection string.
3. Verify in that app that ConnectionStrings is not null before using it.
4. Get the connection string property and print it.
Then if that doesn't work then you can post the entire class and the entire app.config. Do not include real info in the app.config all you care about is that it get a value not what is in it.
|
|
|
|

|
i am developing a win apps where many .rdlc are there in report folder of that project. when i will create a setup for delivery to client then do i need to include all those .rdlc file manually or it will be included automatically like .rpt (crystal report) files.
what i can do as a result always .rdlc files will be automatically included when i will batch build of my project. anyone can guide me. thanks
tbhattacharjee
|
|
|
|

|
I found that reports tend to grow, usually AFTER the application has been deployed and has been used for some time. Also if you have different customers they often want distinct reports.
I had all my reports in a table, all records had a stored procedure name and a file name, if the file existed and the procedure existed the report could execute.
I could then distribute a new report without having to recompile and distribute the app. Simple deliver the file and a script to create the stored procedure and report record.
Never underestimate the power of human stupidity
RAH
|
|
|
|

|
i understand that you are talking about RDL report which is stored in sql server database but here i asked about RDLC which is client side.i asked how could i distribute my rdlc files with my application setup as a result when client install my setup then he can view the report which is based on rdlc. i like to know what is industry standard way to include rdlc into setup project. if you such thing then please advise. thanks
tbhattacharjee
|
|
|
|

|
No I was talking about a strategy for distributing RDLC reports. You can include the reports in a folder in your setup project. I don't believe there is an 'industry standard' as most installer tool work differently.
I find that the reporting requirement changes as the user gets familiar with the application and additional reports are always needed AFTER delivering the application.
Never underestimate the power of human stupidity
RAH
|
|
|
|
 |