Click here to Skip to main content
15,897,226 members
Home / Discussions / C#
   

C#

 
GeneralRe: ScrollBar makes XNA Freeze Pin
invader826-Mar-09 4:36
invader826-Mar-09 4:36 
GeneralRe: ScrollBar makes XNA Freeze Pin
garyhibb17-Jan-12 4:59
garyhibb17-Jan-12 4:59 
Questioncreating dynamic textbox Pin
muniratnam6-Mar-09 1:12
muniratnam6-Mar-09 1:12 
AnswerRe: creating dynamic textbox Pin
Deresen6-Mar-09 2:00
Deresen6-Mar-09 2:00 
GeneralRe: creating dynamic textbox Pin
muniratnam6-Mar-09 18:10
muniratnam6-Mar-09 18:10 
GeneralRe: creating dynamic textbox Pin
jaypatel5128-Mar-09 4:49
jaypatel5128-Mar-09 4:49 
QuestionCall method defined aspx.cs from Javascript? Pin
anish27patel6-Mar-09 0:53
anish27patel6-Mar-09 0:53 
AnswerRe: Call method defined aspx.cs from Javascript? Pin
Guffa6-Mar-09 1:20
Guffa6-Mar-09 1:20 
QuestionListbox item text Pin
yesu prakash6-Mar-09 0:37
yesu prakash6-Mar-09 0:37 
AnswerRe: Listbox item text Pin
DaveyM696-Mar-09 0:43
professionalDaveyM696-Mar-09 0:43 
GeneralRe: Listbox item text Pin
yesu prakash6-Mar-09 1:01
yesu prakash6-Mar-09 1:01 
GeneralRe: Listbox item text Pin
DaveyM696-Mar-09 1:13
professionalDaveyM696-Mar-09 1:13 
AnswerRe: Listbox item text Pin
Xmen Real 6-Mar-09 2:52
professional Xmen Real 6-Mar-09 2:52 
GeneralRe: Listbox item text Pin
Luc Pattyn6-Mar-09 4:23
sitebuilderLuc Pattyn6-Mar-09 4:23 
QuestionWebBrowser control issue Pin
echoDreamz5-Mar-09 23:59
echoDreamz5-Mar-09 23:59 
AnswerRe: WebBrowser control issue Pin
N a v a n e e t h6-Mar-09 0:16
N a v a n e e t h6-Mar-09 0:16 
GeneralRe: WebBrowser control issue Pin
echoDreamz6-Mar-09 0:19
echoDreamz6-Mar-09 0:19 
QuestionProblem with TableAdapters and Transactions. Pin
hdv2125-Mar-09 23:55
hdv2125-Mar-09 23:55 
AnswerRe: Problem with TableAdapters and Transactions. Pin
N a v a n e e t h6-Mar-09 0:14
N a v a n e e t h6-Mar-09 0:14 
GeneralRe: Problem with TableAdapters and Transactions. Pin
hdv2126-Mar-09 2:39
hdv2126-Mar-09 2:39 
Hi N a v a n e e t h
because my above code make our transaction promote to msdtc, the speed almost decrease and make speed lower, however i extended one of my tableAdapters and add two simple methods like this :
namespace TransactionScopeInsertSample.TestDataSetTableAdapters
{
    public partial class t5TableAdapter : System.ComponentModel.Component
    {
        public SqlConnection OpenConnection()
        {
            if (this._connection == null) this.InitConnection();
            if (this._connection.State != System.Data.ConnectionState.Open)
                this._connection.Open();
            return this._connection;
        }

        public void CloseConnection()
        {
            this._connection.Close();
        }        
    }
}


now, i use this code to make my code transactional (without promote to msdtc) :
// Using TransactionScope class with TableAdapter (Extending TableAdapter class)
using (TransactionScope ts = new TransactionScope())
{
	try
	{
		TestDataSetTableAdapters.t5TableAdapter adapterT5 = new TransactionScopeInsertSample.TestDataSetTableAdapters.t5TableAdapter();
		TestDataSetTableAdapters.t6TableAdapter adapterT6 = new TransactionScopeInsertSample.TestDataSetTableAdapters.t6TableAdapter();

		adapterT6.Connection = adapterT5.Connection;
		adapterT5.OpenConnection();

		adapterT5.Insert(int.Parse(this.textBox1.Text));
		adapterT6.Insert(int.Parse(this.textBox2.Text));

		adapterT5.CloseConnection();

		ts.Complete();
		MessageBox.Show("Values inserted!");
	}
	catch (Exception ex)
	{
		MessageBox.Show(ex.Message);
	}
}


but my question is that, is this best practice ?
GeneralRe: Problem with TableAdapters and Transactions. Pin
N a v a n e e t h6-Mar-09 17:24
N a v a n e e t h6-Mar-09 17:24 
GeneralRe: Problem with TableAdapters and Transactions. Pin
hdv2127-Mar-09 9:37
hdv2127-Mar-09 9:37 
Question[Message Deleted] Pin
Rajeev Dhiman5-Mar-09 23:45
Rajeev Dhiman5-Mar-09 23:45 
AnswerCrosspost Pin
Dave Kreskowiak6-Mar-09 4:19
mveDave Kreskowiak6-Mar-09 4:19 
Questionhow to convert a string (D10 : E 20) to a range object? Pin
abhiram_nayan5-Mar-09 22:29
abhiram_nayan5-Mar-09 22:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.