|
Problem Scenario:
We have a database with information.
We have some ASP.NET web applications that request information from this database.
We do not want to give these applications direct access to the database.
Solution:
So, we planned on creating an API layer with some c# objects (ADO.NET objects) that access the database and instantiates some objects with the information stored in their properties.
The applications will then be able to access the information from these C# objects, instead of directly connecting to the database.
We have to make sure that these objects are alive even if the web application is stopped.
To make a long story short, we basically want to create some stand-alone application (may be a windows service in C#) that exposes an API for the web applications. This stand-alone application has objects that act as caches by maintaining the up-to-date information. Whenever the server is on low load, it updates the database with the latest information it has. All applications should be able to access objects of this stand-alone application to get the information. This stand-alone application should live for ever, ideally until the machine on which it runs is shutdown.
Question:
Which type of project in Visual Studio should I create to develop such c# objects? Will Windows service be a solution? if so, how can I access the objects created by it?
Any help is greatly appreciated.
|
|
|
|
|
siali wrote: Will Windows service be a solution?
Definately
siali wrote: if so, how can I access the objects created by it?
It's called Remoting. MSDN has many samples on this scenario
|
|
|
|
|
do you mean .NET Remoting? Does it use TCP?
|
|
|
|
|
How I can send messages SMS to a cellular telephone from my application?
Exists some Web service?
(In Code Project there is an example, but it does not support my country, Argentina)
Thanks!
|
|
|
|
|
|
I forgot to say, must be free.
|
|
|
|
|
This one[^] is good, but it doesn't cover Argentina either (it works for Brazil, if you ever need it). I always have the same problem with Mexico .
Luis Alonso Ramos
Intelectix
Chihuahua, Mexico Not much here: My CP Blog!
|
|
|
|
|
Plz see this.
I don't know how much it will helpfull to you. But it will nice.
for more information search "microsoft smssender" on google.
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
I want to know how to write in C# the following:
We have an xml file on a server and when the server is down, we should be able to display a message saying "Failed to Load File b/c server is down"
How can I write this in C#.
Please help, as I have checked the internet for sample codes but couldnt find any.
Thanks
|
|
|
|
|
Is it possible with GDI+ to just crop an image withou creating a new one?
I'm working with, say, 5 Mpix photos, so It can be superfluous, to create a cropped 4 Mpix bitmap and then drawing the first one to this.
I believe there is something similar to array reallocation applied to images...
|
|
|
|
|
No.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i would like to convert my xml file to *.sav file (SPSS). is there any program out there that i can use or if i want to create my own then how would i create .sav file in c#.net and the variable names for SPSS file
|
|
|
|
|
Hi,
I have a normal windows form with a bunch of tabpages on it. But at the beginning, I want to do a little DirectX intro (which I've already created) in a class that I've been running separately. Now I'm not sure how to put them together without having to close the intro form and then open the main form. Is there any possible way to, say, create a surface on the main form that will run the directx stuff? I can't find any examples on this. Or any other thoughts?
Thanks!
Mel
|
|
|
|
|
I did it in C++ with a static (label) control. If something like that is what you're looking for, check out my 'Modeler' article here on CP.
My Music | My Pics | My Articles
BlackDice
|
|
|
|
|
Thanks! That's exactly what I'm looking for.
Cheers,
Mel
|
|
|
|
|
Hi,
I am working on windows .NET application.
Here I have few comboboxes which i bind with my datatable.
Now I wanted the first item to be blank item so After I queried my datatable from database, I add blank row at the top of my datatable and then bind my datatable to the combobox.
Following is the code to bind the combobox with first item as blank:
dsDataSet.Clear();<br />
theAdapter.Fill(dsDataSet, "Table");<br />
tblTable = dsDataSet.Tables("Table");<br />
myRow = tblTable.NewRow;<br />
<br />
myRow("DisplayField") = "";<br />
<br />
myRow("KeyField") = 0;
<br />
tblTable.Rows.InsertAt(myRow, 0);<br />
objCombo.DataSource = null;<br />
objCombo.Items.Clear();<br />
objCombo.DataSource = tblTable;<br />
objCombo.DisplayMember = "DisplayField";<br />
objCombo.ValueMember = "KeyField";
Now Problem is that after I bind the combobox, If i do following
cbo.selectedvalue= <somevalue>
Here my <somevalue> is the value of the first actual item after the blank.
it is throwing an exception.
------------
In Method: Void set_SelectedIndex(Int32)
Specified argument was out of the range of valid values.
Parameter name: '-2147483648' is not a valid value for 'index'.
-----------
Any idea why is this happening?
here using selected value i am selecting the first item after the blank item in combobox.
Thanks
Lav
Lav Pathak
Application Developer
Auxiliary Enterprises
Kalamazoo, MI
|
|
|
|
|
Hi!!
Because i need to create about 50 panel with mouse event. how i can create an object array in C#?
I tried
Panel[] mPanel = new Panel[50] ;
it does not work. How can i compete it??
thx thx!!
|
|
|
|
|
That allocates the array. You then need to initialize the array:
for(int i = 0; i < mPanel.Length; i++)
{
mPanel[i] = new Panel();
}
That said, I seriously question why you need to create 50 panels; especially during each mouse event. What are you trying to do?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: How 'bout a little guitar now?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Does anybody know if there's a particular property that controls the selectable area of a tab? I'm creating a new class that extends TabControl in order to override the paint method and draw custom tabs. However, the selectable area of the tabs do not reflect the actual painted rectangle. None of the TabSizeMode properties of the TabControl seem to work. The "Normal" option is supposed to take into account everything that's within the tab, but it doesn't. The selectable area turns out to be governed only by the length of the text within the tab. I was willing to comprimise and set the mode to "Fixed", but that didn't work either.
I'm considering trying to capture the Mouse Event triggered when entering the ClientRectangle of the TabPage and overriding the Click event, but I'm hoping there's a more elegant way to control the selectable area.
Any help is greatly appreciated.
Thanks!
Josiah
|
|
|
|
|
HI,
I got trouble of sending an email out from my application. An exception happened when from smtpclient.send object .
Any suggestion?
Thanks.
Kyah
|
|
|
|
|
Could you give us some information on the exception? what type? what was the error message?
Also, could you post some your code (the 10 o 15 lines where you send the email)? From what you say it's hard for us to know the problem.
Luis Alonso Ramos
Intelectix
Chihuahua, Mexico Not much here: My CP Blog!
|
|
|
|
|
I just followed the sample code in the MSDN library for Visual Studio in 2005.
The exception:
System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: U
able to connect to the remote server ---> System.Net.Sockets.SocketException: An est
blished connection was aborted by the software in your host machine
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress s
cketAddress)
at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s
, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncRes
lt asyncResult, Int32 timeout, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner,
Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32
imeout)
at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 tim
out, GeneralAsyncDelegate asyncCallback)
at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asy
cCallback)
at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDeleg
te asyncCallback, Int32 creationTimeout)
at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port)
at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port)
at System.Net.Mail.SmtpClient.GetConnection()
at System.Net.Mail.SmtpClient.Send(MailMessage message)
--- End of inner exception stack trace ---
at System.Net.Mail.SmtpClient.Send(MailMessage message)
-----------------
I just want to send a test to my network mail server not local machine.
Thanks.
Kyah
|
|
|
|
|
I haven't seen the code, but I would guess you are trying to use localhost as your SMTP server when the service has not been enabled. Could you post the code?
Luis Alonso Ramos
Intelectix
Chihuahua, Mexico Not much here: My CP Blog!
|
|
|
|
|
I have run into this problem. In my case, our Virus software was preventing the mail from being sent. Our administrator had to allow mail coming from my machine for the vshost.exe process.
|
|
|
|
|
I'm having a problem with a graphics control I'm working on. It seems that the Graphics.DrawImage method is clipping a half pixel off of the image, and then shifting it up and left by that half pixel. This can usually only be seen when zoomed in 2-4x or more, but now that I know what to look for, I'm seeing it happen even close to 1x with certain images. The following image shows the extent of the issue when zoomed in significantly - the green lines you see are where the bounds of the bitmap should be: odd_image.jpg[^]
The graphics object that gets drawn to is from a bitmap that gets created on the fly depending on the size of the control and the objects in it. All graphics properties are set to the default except for the following:
g.InterpolationMode = InterpolationMode.NearestNeighbor
g.PageUnit = GraphicsUnit.Millimeter
and there is a translation applied (though removing it did not affect the problem).
I tried changing to the PageUnit to various values with no change, I also messed with PixelOffsetMode, CompositingMode, CompositingQuality and SmoothingMode, trying various values to no effect.
I've done several searches in here and MSDN and found nothing that fixed the problem, or even hints that there is one. Has anyone seen anything similar to this, or have any ideas to try?
-----
In the land of the blind, the one eyed man is king.
|
|
|
|