|
An XML Web Service is in no relation to stored procedures. They do entirely different things and can be used together or apart.
A stored procedure is simply a procedure implemented in a Relational Database Management System (RDBMS). It gives you flexibility of separating logic from data (the stored procs and data could even exist on separate RDBMSs) and implementing complex procedures that would otherwise be problematic in code (coding SQL commands in your code makes your compilations less robust).
XML Web Services describe a standard whereby a common format (SOAP, an XML "grammar", or schema) is sent over HTTP or HTTPS. An XML Web Service that queries data could use stored procs to read/write data, or something not even related to data.
The question you have to ask yourself is about architecture first. Do you need to go across disparate networks (like a WAN)? Do you need to support many different types of clients (written in, perhaps, many different languages and on different platforms)? If yes to either, then Web Services might be your answer. That still doesn't rule out stored procedures, though.
Regarding stored procedures, do you want to support complex queries? Do you want to maintain robust code? If yes to either of those, then using stored procs is probably your best bet (and I honestly can't think of too many reasons for not using stored procs if even one of your queries is just more than a simple, single SQL command).
With regard to security, it is different questions you must ask yourself. If you do use XML Web Services and need to protect data across the wire, then you should use HTTPS instead of HTTP (HTTPS is HTTP over SSL, an encryption algorithm). You could also use WS-Security standards that you can read about on http://msdn.microsoft.com/webservices/building/wse/[^], as well as download the Web Service Enhancements from Microsoft which impements these common standards (please note that while Microsoft is a major player in defining these standards, there is a consortium of vendors like IBM and others. The WSE is just Microsoft's implementation of WS standards, just like .NET is Microsoft's implementation of the Common Language Infrastructure, or CLI).
If you're using stored procedures, you should use role-based authentication and authorization in the RDBMS. SQL Server supports this, as well as others. Don't just accept the default authorization and permissions.
There's so much more when dealing with security and robust code. If you need information on either subject, I recommend reading some of the many great and FREE online books (you can also order print editions) at http://msdn.microsoft.com/patterns[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Heath,
First and foremost, thank you for the very well written response!
More detail is in order, so as to ellicit more knowledge:
We currently have >160 DC's, spread out all over the globe. The initial phase of my project will include only the US based DC's (>130), which are connected via multiple WAN links (redundancy via routed network).
The data that I am trying to acquire is merely the DIT File size for each DC. I would like to have a "scheduled task" that grabs that data and inserts the file size & time into a SQL 2000 DB. The task will be run every 3 hours from 8am Eastern to 11pm Eastern and the data will be displayed in an C# DataGrid (DC Name, Baseline, 2nd oldest data, 1st oldest data, most recent data).
Based on the above information, what makes the most sense for data acquisition and population into the database?
Thanks again for your knowledge and guidance!
Cordially,
- - -
KoalaCowboy
Knowledge Monger
|
|
|
|
|
While this has extended well beyond a C# question, I will answer this once.
I personally would use MSMQ (Microsoft Message Queue) where each DC posts a message containing the data you need to a queue asynchronously. Why go to the overhead of a request/response mechanism when it's not needed (HTTP is, by protocol, a client request/server response protocol).
The listener on the queue takes this information and posts it in SQL Server using a simple SqlCommand . Use a stored procedure to separate logic and abstract your implementation so that you can change a small piece without recompiling and testing the whole solution (modularize).
The .NET Framework supports MSMQ in the System.Messaging [^] namespace, which you can read about in the .NET Framework SDK. The documentations includes many examples.
Note that the MSMQ server can be installed on Windows 2000 (Workstation and Server), XP (Professional), and 2003. It is not typically installed by default.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Heath,
Thank you for the pointed information! Lots of reading ahead.
Regards,
KoalaCowboy
Knowledge Monger
|
|
|
|
|
i have a pool of threads (max is 20), what they do is every so often (at the moment its every second) they monitor an inbox (email) for new emails and if it finds one it processes it!!!
however i know need to incorporate a new requirement which introduces a time delay ie poll an inbox for new emails on the first of every month, or every day/hour or every 3rd week of the month.
now if i use a threadpool (max of concurrent threads is 20) i could have a thread sat on there till the first of the month waiting to be executed doing nothing, therefore preventing other threads from getting executed. the question then is "Now how can u monitor multiple inboxes using threadpools (or somethign else for that matter), for new emails , which would allow u to include a time delay and not have a big effect on CPU processing or on the overall performance of the architecture?"
any ideas would be welcome, this has been bashing my head for days
|
|
|
|
|
hi,
i'd like to write a control.name to a text file during designtime.
i cant find a property or function like "OnNameChanged" or something like that.
is there any idea to solve this problem.
background is to localize a project. i'm using global an local resources.
during designtime i'd like to write the names of the control to my local resx(txt).
if localization is enabled in the form, VS writes the changed name in the resx owned by the form. the same i'd like do to with my local.resx during designtime. at the moment only with the control.name.
at the moment i have a LocalizedButton derived fom Button.
How is it possible to write the changed name during designtime to a txt file?
hope someone knows what i mean......
greetz
|
|
|
|
|
hi,
You can monitor the chages provided you need to go for a custom event.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
sreejith ss nair wrote:
You can monitor the chages provided you need to go for a custom event.
what do you mean? dont understand it.
sure i can write my custom event who is firering when the name is changed.
but i STILL DONT know when the name property is changing.
how can i monitor the value without polling.
is it possible to override the setter method of the name propertiy or something like that.
or use the internal functions like VS does?
greetz
|
|
|
|
|
come on....
no ideas??
it must be possible do design a button who has is own new name property....
plz guys, help me!
|
|
|
|
|
Well, I can't imagine why you would want to do this. But, I can imagine a ton of problems with your idea.
Anyway, in order to get a custom event to fire, you'll have to make your own button class, inheriting from the SYstem.Windows.Forms.Button class. You'll have to expose your own Name property that includes the code to expose an OnNameChanged event. You'll fire off the event inside the Set code for your Name property. Then, you just use your Button class in place of the Windows.Forms Button class.
Now, you're going to run into the huge problem of each button instance knows nothing of the environment in which it exists.
How is each button going to know into what file it has to put it's new name? How is this file going to be identified? Better yet, how is each button going to know about it? They're not, unless...
You'll have to supply a mechanism in your OnNameChanged event to communicate with a plugin you have to write for the IDE that will expose this kind of information and a user interface so you can specify this kind of information.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i need this for a localization project.
there ill have so called global localized controls with a global translated resx file.
but for the non global controls i'd like to have the possibility to write the name for
the Name.Text property in this txt. for later local translation of the controls.
hope someone can imagine what im trying.....
the file will always resist in the root directory of the project per default,
and is always called local.txt
so i only have to test if the file exists, if not i'll generate a blank txt file.
sounds simply in my ears.
but i think ive just found a solution for my problem.
if it's so i'll post here what i've done.
thx for your answer!
greetz
|
|
|
|
|
I want to change a RowState property of a DataRow from a DataTable manually.
in example , i want to change from "Unchanged" state to "Added" state.
thanks.
|
|
|
|
|
Hi
I don't think it is possible.Because RowState property of DataRow is a read only property.out side code can't change its value.
Public ReadOnly Property RowState() As System.Data.DataRowState
Member of: System.Data.DataRow
Just go and look at all members of DataRow using object browser.
(Use Alt+Ctrl+J shortcut in .NET IDE)
M.Sendilkumar
Chennai.
|
|
|
|
|
hi,
You wrote :
I want to change a RowState property of a DataRow from a DataTable manually.
RowState property is used to get the current state of row. And it is a read-only property. You can access but you can't set the value.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
I'm new with programming winform. I want to know how to draw a new control or extend a control. Please help me. Thanks in advanced.
kunkun
|
|
|
|
|
Hi,
you can create new controls by
Inherit from an existing control or
Inherit from UserControl or
Inherit from Control.
Thanks,
SGS
|
|
|
|
|
Thanks a lot but can you give me some documents?
kunkun
|
|
|
|
|
hi,
In codeproject we have lot of articles with example which help to to design user controls. Please do some search for these sort of article here in codeproject.com
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
I am using a datagrid in my form
sometimes when a child form of this datagrid form closed
an exception like "Column C does not belong to the table T" was thrown.
this exception is rarely occured so rarely and I can not find the way that
it was generated, so I can not debug the the exception.
does anybody know how to generate this exception and how to handle it.
|
|
|
|
|
hi,
The exception is because you are accessing some column which is doesn't belongs to that perticular table. Reason may you are using datatable which is in form1 to some other form. And the point your are closing the form. The entire object are disposed. See better try to catch your exception and getback to me.
try
{
//Put your logic here
}
catch(exception Ex)
{
MessageBox.Show(Ex.Message.ToString());
}
Check what are the avilable (members) which you are accessing outside your form1 class file.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Thanks for your guide.
I know how can I catch the exceptions in my codes. Also I know if a column does not belong to a table, I couldn't access the column.
But if you read my message again I describe that this error is appeared so rarely. So I couldn't catch it.
regards,
Mehdi
|
|
|
|
|
Control class has an intresting property like Anchor. The SDK Documentation says: "A bitwise combination of the AnchorStyles values. The default is Top and Left". Whatever that means. So what is it ? Some kind of a enumeration ? If I would want to make a property like Anchor then how could I declare it ?
Regards, Desmond
|
|
|
|
|
hi,
Anchoring means keeping the position of the control fixed no matter if the user try to resize the form. You will get the anchoring feature while inheriting any built-in control into your custom controls.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Like the documentation says: It's a combination of AnchorStyles (an enumeration) values.
The AnchorStyles enumeration has the [Flags] attribute set, this means arbitrary combinations of enumeration values can be combined using bitwise OR.
For example:
myControl.Anchor = AnchorStyles.Left|AnchorStyles.Top;
Setting a flag:
myControl.Anchor |= AnchorStyles.Bottom;
Clearing a flag:
myControl.Anchor &= ~AnchorStyles.Bottom;
Testing for a flag:
if ((myControl.Anchor & AnchorStyles.Top) == AnchorStyles.Top) ...
Regards,
mav
|
|
|
|
|
To add to everything else that was posted...
For example, In your class, AnchorStyles will become a data type for an Anchor property that your class exposes. Since you want your enumeration members to be used by outside code, you'll make sure they're public also. Now, when you define to class' Anchor property, you'll do it something like this:
public class myComponent
{
[FlagsAttribute]
public enum AnchorStyles
{
Left = 1,
Top = 2,
Right = 4,
Bottom = 8
};
private AnchorStyles m_Anchor;
public AnchorStyles Anchor
{
get
{
return m_Anchor;
}
set
{
m_Anchor = value;
}
}
}
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|