|
I have created a connectionstring type (SpecialSetting) to store my database connection string. However, I failed to bind property of an SqlConnection object in the form design and error pops up immediately.
Object of type 'Microsoft.VSDesigner.VSDesignerPackage.SerializableConnectionString' cannot be converted to type 'System.String'.
Is there anyway I can fix this whilst the connection string remains in the special setting type and not a string type. Surely, MS made that facility for storing connectionstrings.
Thanks
Using C#, .NET 2.0 development, Windows XP SP2, Visual Studio 2005
|
|
|
|
|
I'd guess that ToString or a property on the class will do it for you.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Everything you may need is here[^]
SkyWalker
|
|
|
|
|
hi all
i have a doubt, that
when i have several "select" queries for different tables, different criterias in same table, SHOULD I USE seperate DATASETS for each query?
pls reply me.
since i did like that, so that the no of datasetsi increased in my proj?
pls suggest?
thanks in adv
kssk
|
|
|
|
|
if you have several queries with the same result you should recycle your DataTable - so no in this case don't use multiple Datasets.
If you query different Tables the answer depends on your taste - I tend to use one DataSet for Tables in the same "category" on the same Database so I never get more then 2-3 datasets in my projects - but sometimes people use one dataset for each table ....
|
|
|
|
|
You shouldn't have to have separate datasets for each query. If you are using the same tables and fields, you can have different Fill, Get methods for each query.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi all,
It’s my very first time posting any problem in the forum like this. I am expecting proper responses from u expert friends.
Problem is that I am in dilemma that which of the technique I should use in the scenario mentioned below.
I have got a server installed in my LAN and I need to send an XML file/string to the client which exists out of my LAN using internet (of course). There may around 500 to 600 client access my server for the data.
Please suggest me which of the techniques:
a. Remoting
b. Web Services
c. Socket
Can solve my problem.
Some constraints are the for each of the techniques as
a. If I go by Remoting, it’s difficult to apply it over internet and not even reliable too as any of the firewall can restrict it.
b. If I go by Web Services I need to have IIS installed on the client’s side which cannot be done for the cost reasons.
c. If I go by sockets again the problem with the firewalls arises.
Please suggest me a proper technique and solution of get ridge of the above mentioned problems associated with each of them.
Note : I am working on C#.Net with the framework 1.1.
Thanks in advance.
|
|
|
|
|
Remoting has a variety of issues, and sockets would just be a pain.
Without knowing about how often you need to send data, I suggest you examine running a web service on _your_ end, and having the clients poll for data.
|
|
|
|
|
Hello Sir,
Thanks for the early response.
But the problem is our architecture does not permit this.
In our case client should not PULL the data rather server should PUSH the data to the client knowing the internet IP of the client.
any solution for this type of case..????
Thanks in advance.
|
|
|
|
|
With any form of "push" mechanic you will need to have correctly configured firewalls. This will be a massive pain. I strongly suggest you take a second look at your requirements and see if "push" is really necessary.
What information are you planning to send that requires the client to know about it immediately? What are the results of the client not finding out for a minute, 10 minutes, or a whole day?
Firewall problems like this should have been considered as part of the initial design.
|
|
|
|
|
Sir,
I am on a project of emergency management, so by this you may be able to understand that the xml information needed to be send to the client is prime importance. I cannot afford delay of any second even.
Thanks.
|
|
|
|
|
Is this information to be consumed by a human or by automated systems? It would be completely feasible to poll for messages every 15 seconds or even less. MSN Messenger will switch to HTTP polling when behind firewalls - and that is usable for "instant" messanging.
If specifications use words like "immediately" I often find that the real requirement is "within a minute". If IIS and firewall issues are a problem then I suggest you client rethink their budget or their requirements.
If you really need realtime communication, then you will need to establish a permanent link to the server from the client. Sockets or remoting will be suitable for this.
|
|
|
|
|
Remoting will be easier than direct sockets. Romoting and direct sockets will have the same issues with configuration of the firewall. Based on the restrictions you have mentioned, remoting over tcp seems like the most workable solution.
Webservices would be the easier way. Remoting over http is similar to webservices, but if you can't run iis on the other side, neither will work.
Another option would be to run an ftp server on the other side but if they are reluctant to install iis then ftp is likely not an option either.
http://blog.darrenstokes.com
|
|
|
|
|
Hi - as mentioned in the other reply: use a webservice!
The clients won't have to install the IIS - they will just have to access your IIS to get the wsdl service description and communicate with it.
|
|
|
|
|
ya u are right but the thing is I dont want the webservice to be called by the client but server should send the file to client by itself provided that the internet ip of the client is known..
I think i missed this point hope you are clear with the senario.
I dont want PULL mechanism at client side but PUSH at server side.
|
|
|
|
|
First you should ask yourself if you really need the PUSH - mechanic.
I'm not an Webservice expert but I think you can't handle this with it.
No matter what you will have to provide the client with some kind of software - so why not provide with a polling client app?
(Do you really want your server to PUSH several hundred files over the internet when you are not sure if the client still listens or even wants this?)
|
|
|
|
|
ok..let me tell you real senario.
in my case client is connected with the server whole 24*7, i.e., server will be having the internet Ip of the client all the time(so client will be ready to take the data every time the server is sending the data).
and as i said there may be 500-600 different client accross the internet network for the server to send the data and server will map the data to the correct client will send the data.
any other solution??
Thanks in advance.
|
|
|
|
|
Dear All.....
I am using .Net Remoting with C#.
I want to access windows Form, from the Client. Means on calling some function from the client windows form at server end should be invoked (activated).
So accessing Form's object as singleton object in client side and trying to activate that form.
Now the problem is, That form (Form1) becomes activated but hangs also. Message Box which is in Form1's Load Event is visible but still Form1 is hanged. Server Form and Client Form is not hanged, and are workable.
Application not throwing any exception. So suggest me, what to do. Or how i can access form on Server Side using .Net Remoting.
Thx 4 Reading...
Enjoy Programming!
Sid
|
|
|
|
|
Well if a modal MessageBox is open (that is shown in form_load) will of course hang the parent form (yeah the dialog is *modal*).
And if I get you right you are publishing your form-object via remoting? You should not do something like this! Better use a static class and event with remoting.
|
|
|
|
|
I develop a mobile telephone program using c#,I need to test if the mobile signal is working or in good state,how to deal with it?
|
|
|
|
|
|
hi all
can any one help me how to disable all buttons in a form except few using a method.
I coded to disable all buttons as:
private void disable_buttons()<br />
{<br />
foreach (Control ctrl in this.Controls)<br />
{<br />
if (ctrl.GetType() == typeof(Button))<br />
{<br />
ctrl.Enabled = false;<br />
}<br />
}<br />
<br />
}
but when called from same class load event it doesnt works?
pls suggest me for this problem?
<br />
private void UserMaster_Load(object sender, EventArgs e)<br />
{<br />
disable_buttons();<br />
}<br />
thank u
Kssk
|
|
|
|
|
Are you calling it before the initialize method which creates the controls and also enables them ? It should work, it will disable all buttons, you need to reenable the ones you don't want to disable.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
this might have the problem that buttons inside panels or frames are not disabled (just use a recursive walker).
Concerning your question: as was said before: disable all and then enable the ones you like or give every button a describing Tag (for example a groupname or whatever) and check for this Tag in you foreach-loop to only disable the ones in the given group.
|
|
|
|
|
if you replace if (ctrl.GetType() == typeof(Button)) by if (ctrl is Button)
you get simpler code, that recognizes Buttons as well as controls that inherit from Button.
|
|
|
|