|
Hi
I'm running couple of SQL Server instances in two different instances, Instance A is the master which replicates the data to Instance B. Im running Transaction Based replication, which working well.
Now I want to route the WRITE (Insert, Update, Delete) calls from my ASP.Net application to Instance A and READ (Select) calls to Instance B?
Is there any load balancing mechanism available to do this?
Thanks
|
|
|
|
|
C# forum is probably not the correct place for this, I doubt if the database forum will be any better but I would try there. You may be better served by using a dedicated database site - SQLServerCentral.com comes to mind. This really is a DBA type question (rather than a developer question).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
satsumatable wrote: Now I want to route the WRITE (Insert, Update, Delete) calls from my ASP.Net application to Instance A and READ (Select) calls to Instance B?
Have you tried anything?
The databases only have replication running between them right? So that means that the two databases are distinct entities that can be connected to using separate connection strings. If your application has a dedicated DAL, all the change you need to make is have two separate methods that open a connection, something like
OpenConnectionForWrite()
OpenConnectionForRead()
and your code can call the appropriate method depending on whether it's reading or writing.
SG
Aham Brahmasmi!
|
|
|
|
|
I m planning to develop a payment gateway Application.
Do any body have some tutorials or sites where i can get some good exposure to Payment gate way development
Thanks in advance
|
|
|
|
|
I would like to know how often you all build and run a project during development. As far back as I can remember, when I first started programming (C++ with the Dev-C++ IDE) I find myself building/running a project quite often. Usually every time I add something new or fix a problem in the code.
Is there some sort of general practice for how often you should do this? Or does that not matter? BTW, I am referring to developing on a single machine. I don't have any experience in a team environment and I have never used any kind of source control.
|
|
|
|
|
Build early, build often.
|
|
|
|
|
Thanks. That's what I figured but I had a bit of doubt at first, thinking something is wrong if you must build quite often. :-P
|
|
|
|
|
I build all the time. When I add 10 lines of code, I build, run, test and fix. When I change a few lines, ditto. I make sure my project can always be built, and all new/modified code gets tested right away.
|
|
|
|
|
I used to build the component that I work and it's dependencies frequently. But I usually won't build the whole application all the time as it takes more time. On the current project we have a continuous integration server available which will build the whole project once the code is checked in.
Build architecture for C++ projects and C# projects are different. C++ uses incremental approach and only those files that are modified gets compiled. This is a huge time saver after the initial compile. In .NET (except C++/CLI), this is handled at the project level. So if any of the files got modified in the project, VS will compile the whole project rather than just one file. So improper project organization will lead into longer build time.
Best wishes,
Navaneeth
|
|
|
|
|
There is nothing wrong in building your project.
build and run as much as you can and be happy watching your project work in right way
|
|
|
|
|
Build early, and build often.
It serves two purposes:
a) It ensures that what you have written recently compiles cleanly while it is still fresh in your mind.
b) It ensures that all changed files are saved. You can never save too often! "Nice computers don't go down" perhaps - but all the ones I've used have!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
OriginalGriff wrote: Nice computers don't go down
Gotta be worth a 5!
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier.
Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
"You can never save too often!" -- I agree completely. When I first picked up on C++ I had a really old Windows 98 SE system. I received crashes quite often due to low memory, CPU, etc. At that time I typically only saved when I got ready to test new code I had added. When it would crash I would lose so much work.
So I have made a frequent habit of hitting Ctrl+S. Even if I add a previously forgotten punctuation mark in a comment, I usually go straight to Ctrl+S.
Thanks everyone for your responses. I don't feel so odd about it now.
|
|
|
|
|
Don't let a PC lull you into a false sense of security.
"It hasn't crashed for ages! just means it's waiting for the most inopportune moment to do the nasty on you.
Save often.
Copy files from project to somewhere else if you don't use source control.
If you go for source control look for one that works rather than SourceSafe.
|
|
|
|
|
Hello,
I want to know how can i encrypt an xml file that contains my connection string properties include username and password.
Thanks a lot.
|
|
|
|
|
|
If you're using SQL Server, use integrated security instead.
|
|
|
|
|
If you read and write the XML file using a text or XML streamer, you can just plug a CryptoStreamer in.
|
|
|
|
|
Hi,
I'm writing an application so that I can hotkey between several different applications. I know how to register and unregister the hot keys, where I need help is obtaining the windows title to compare and give that application focus. What I believe needs to happen is I need to iterate through each window/form to determine if this is the correct one, then switch to it.
Any help or if you know of a programming example it would be greatly appreciated.
Thank you,
Glenn
|
|
|
|
|
I think you may be taking the wrong approach. IIRC, when an application registers a hot key, Windows notifies the application when the hotkey sequence is triggered. What you seem to want to do is build a master app that directs notifications to other apps. See this[^] recent article.
/ravi
|
|
|
|
|
What I'm actually trying to do is setup fast pathing to an application. IE: If I hit the 1 on my numeric keypad it will go to my email, 2 will take me to Visual Studio, 3 will be my browser, etc.
Glenn
|
|
|
|
|
|
Unless you are doing it yourself in code for the practice and experience just install the MS IntelliType driver and you are done.
|
|
|
|
|
You do not really need any app for that. This should work just fine:
- on the desktop, create one shortcut for every app of interest;
- double-clicking it would already run the app;
- for each such shortcut, right-click and choose properties; now click in the "shortcut key" box and hit the key you want to associate with (or hit DEL to remove).
BTW: I trust there are ways to get this done by code too.
|
|
|
|
|
Hi!!
I need some help...
i cant connect to a a client running on a pc over net..
i got 2 programs one client and one server... running successfully when i give my local IP address...
But when i change the local IP address to External IP address... it not working.. plz help me.. i want it to run over internet...
Thanks in advance...
client:
<code>
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Net.Sockets;
public class clnt {
public static void Main() {
try {
TcpClient tcpclnt = new TcpClient();
Console.WriteLine("Connecting.....");
tcpclnt.Connect("120.56.168.186", 8001); // use the ipaddress as in the server program
Console.WriteLine("Connected");
Console.Write("Enter the string to be transmitted : ");
String str=Console.ReadLine();
Stream stm = tcpclnt.GetStream();
ASCIIEncoding asen= new ASCIIEncoding();
byte[] ba=asen.GetBytes(str);
Console.WriteLine("Transmitting.....");
stm.Write(ba,0,ba.Length);
byte[] bb=new byte[100];
int k=stm.Read(bb,0,100);
for (int i=0;i<k;i++)
Console.Write(Convert.ToChar(bb[i]));
tcpclnt.Close();
Console.ReadLine();
}
catch (Exception e) {
Console.WriteLine("Error..... " + e.StackTrace);
Console.ReadLine();
}
}
}
</code>
Server:
<code>
using System;
using System.Text;
using System.Net;
using System.Net.Sockets;
public class serv {
public static void Main() {
try {
IPAddress ipAd = IPAddress.Parse("120.56.168.186"); //use local m/c IP address, and use the same in the client
TcpListener myList=new TcpListener(ipAd,8001);
myList.Start();
Console.WriteLine("The server is running at port 8001...");
Console.WriteLine("The local End point is :" + myList.LocalEndpoint );
Console.WriteLine("Waiting for a connection.....");
Socket s=myList.AcceptSocket();
Console.WriteLine("Connection accepted from "+s.RemoteEndPoint);
byte[] b=new byte[100];
int k=s.Receive(b);
Console.WriteLine("Recieved...");
for (int i=0;i<k;i++)
Console.Write(Convert.ToChar(b[i]));
ASCIIEncoding asen=new ASCIIEncoding();
s.Send(asen.GetBytes("The string was recieved by the server."));
Console.WriteLine("\r\nSent Acknowledgement");
s.Close();
myList.Stop();
Console.ReadLine();
}
catch (Exception e) {
Console.WriteLine("Error..... " + e.StackTrace); Console.ReadLine();
}
}
}
</code>
Can u tell me how shud i use a DNS server... how can i use it to use my program over the internet... plz.. i need to know this.. this is bugging me a lot..
-- Modified Tuesday, August 10, 2010 10:50 AM
|
|
|
|