|
Why do you need 2 connection strings? What is the purpose..changing the database while the transaction is open?
I will use Google before asking dumb questions
|
|
|
|
|
Dear friend,
my rquiremnt is like
1. SELECT some data from servr1.db1.Tbl1
2. INSERT that to server2.db2.Tbl1.
3. UPDATE the status filed of selected data in servr1.db1.Tbl1
If either step 2 or 3 fail I need to Roll back that transaction.
any advice please..
They laugh at me; they think I’m different. I laugh at them, ‘coz they are all same!! CrazySanker
|
|
|
|
|
The ConnectionString property can be set only when the connection is closed. (from MSDN) and when you close a query, the pending transactions are rolledback.
So...my suggestion is to use at least 2 connections
using (SqlConnection conn = new SqlConnection())
{
string cs1 = "connection string 1";
conn.ConnectionString = cs1;
conn.Open();
SqlTransaction trans = conn.BeginTransaction();
if (InsertSecondDB())
{
trans.Commit();
}
else
{
trans.Rollback();
}
conn.Close();
}
The InsertSecondDB should create a new connection and a new transaction to the second DataBase and return true if the query succeeded or false otherwise.
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
defenitely it clicked some ideas in my mind..
Thank you soo much!!
They laugh at me; they think I’m different. I laugh at them, ‘coz they are all same!! CrazySanker
|
|
|
|
|
Dear friends,
During my g0ole search i got this
Distributed Transaction ^]
They laugh at me; they think I’m different. I laugh at them, ‘coz they are all same!! CrazySanker
|
|
|
|
|
how to synchronize file on two pc
|
|
|
|
|
Hi,
There can be several ways, following are some possibilities:
1. Web-service
2. Application loaded in a hidden mode at the system start-up
In the 2nd option there can further be some possibilities as
2.a Client-Server sort of application for 2 PCs
2.b Instances of a same application on both PCs
2.c Event-Trigger sort of application, i.e. generating event and start sending changed/modified file from 1 PC to other
Hope that helps.
Regards,
Adeel
|
|
|
|
|
Hi,
Try looking at some flags of the open dialog.
Regards,
Adeel
|
|
|
|
|
is that no so...
i had seen the flags...
it should be custom control
chandru
|
|
|
|
|
Hello,
I need to find out programatically the encoding format of a text file.
Do text files, have a header which contains the encoding format.
If it does then how do I view it/access it ?
The encoding I am referring to is - ANSI, Unicode, UTF8, UTF4, etc.
Any help is appreciated.
Thanks,
\deepu
|
|
|
|
|
|
Hi,
i fill dataset with the table, i want a particular colunm data from dataset?
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|
|
For that you have to read each data row of that particular table
like
foreach (DataRow oRow in MyDataTable.Rows)
{
value = oRow["CustomerId"].ToString();
}
Where CustomerId is the column name and MyDataTable is the table name.
Regards
Pankaj Joshi
|
|
|
|
|
Thanks
Yogesh Pekhale
pekhaleyogesh@gmail.com
|
|
|
|
|
Please can any one help me in customizing the open file dialog selection.
My requirement is to select a single folder or a single file at a time using one open dialog control using C#.
chandru
|
|
|
|
|
Hello ALL,
I am creating the word document and filling it up with the tables needed. I need to add two tables adjacently , i tried giving a column break but it is not happening . If any one has some clues it will be helpfull.
Thanks in advance
Bharath.S Ron
|
|
|
|
|
Can any one help me how to get the server application path.
I have uploaded the files to the server throught FTP and now i want to prient the appliation path so can any one please help me out how to get the Application path.
Thanks in advance.
chandu
chandu
|
|
|
|
|
clife537 wrote: server application path
HttpRuntime.AppDomainAppPath
or
Server.MapPath
or
AppDomain.CurrentDomain.BaseDirectory
or
Request.Path
or
Request.PhysicalApplicationPath
Vasudevan Deepak Kumar
Personal Homepage
Tech Gossips
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Thanks A lottt.................
I have solved the problem.
chandu
|
|
|
|
|
This website is so good for developer with C# ,I graduated from a college in china at july this year ,now I programme everyday , so many answers I can get from this website, thank you very much ,just for I am a computer lover.
welcome to make friends with people here,my email is suntiger304@qq.com.
|
|
|
|
|
super flower wrote: ,now I programme everyday
Very Good.
super flower wrote: so many answers I can get from this website
Good to hear.
super flower wrote: welcome to make friends with people here,my email is suntiger304@qq.com.
This is considered rude and impolite here. This is a technical discussions forum for health exchange of questions related to technology and knowledge sharing. If you are interested in making friends, Orkut is the best bet source for you.
Vasudevan Deepak Kumar
Personal Homepage
Tech Gossips
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Dear guys,
I'm developing system "object detection (shape &velocities ) using ultrasonic sensors" for my FYP . Where I need to have Data Fusion. I need code to fuse datas at intermediate levels. Any ideas?
hamil
|
|
|
|
|
Hello experts,
Can anybody tell me how I can disable an item in a checkedListBox...?
So end user can check/uncheck only enable items...;P
Regards
Pankaj Joshi
|
|
|
|
|
Hi,
pankaj.indore wrote: disable an item in a checkedListBox...?
there is no direct support for this; but this is what I would suggest (not tested!):
- create a class that describes your listbox item, and give it also an Enabled property;
- create instances of that class to populate your listbox (rather than adding strings);
- make the listbox OwnerDrawn by setting the DrawMode and providing a DrawItem handler;
- make the DrawItem actions depend on Enabled, so the user sees which items are disabled;
- in the ItemCheck event, undo the action if the item is disabled.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
i having two server pc,both pc having big data, i want to maintain synchronize folder and file structure that means if PC A & PC B having file a1.doc if any change happend in pc A's file a1.doc then it should reflect automatically on pc B's a1.doc. so can any one help me how i will achieve this thing by using .net.
|
|
|
|