473,395 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

ConnectionString from webconfig file

115 100+
this is my code
Expand|Select|Wrap|Line Numbers
  1. string txt1 = TextBox1.Text;
  2.         DateTime txt2 = Convert.ToDateTime(TextBox2.Text);
  3.  
  4.         DataSet1TableAdapters.userdetailsTableAdapter useradapter = new DataSet1TableAdapters.userdetailsTableAdapter();
  5.         System.Data.SqlClient.SqlTransaction tr;
  6.  
  7.  
  8.         try
  9.         {
  10.             useradapter.InsertQuery(txt1, txt2);
  11.             tr.Commit();
  12.         }
  13.         catch
  14.         {
  15.             tr.Rollback();
  16.         }
  17.  
  18.  
database connnection am using web.config file

here i want use transaction begins and commit and rollback options

anyone know abt this code

pls quide me

Thanks
Mar 7 '09 #1
3 1328
PRR
750 Expert 512MB
Look into this e.g....
Mar 9 '09 #2
yogarajan
115 100+
@DeepBlue
Thanks for ur example

but am using connection through web.config file so i am not using sql connection string see my code

i need sample for connection through web.config

Please guide me

Thanks
Mar 9 '09 #3
PRR
750 Expert 512MB
You need to specify what exactly you are asking ... From your question it looks like you want to know about Transaction commit and rollback...
As for your question you can use
Expand|Select|Wrap|Line Numbers
  1. ConfigurationManager.AppSettings["keyname"]
  2.  
  3. ConfigurationManager.ConnectionStrings["connectionsstring"].ConnectionString
  4.  
ConfigurationManager.AppSettings


ConfigurationManager.ConnectionStrings
Mar 9 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jase H | last post by:
Hello, I have a ASP.NET web application problem involving the data encryption and decryption assembly(DLL) used on the connection string value that is set in the webconfig file. The problem...
6
by: Buz Waitz | last post by:
I have prepared a site on one machine, but when I move the site to the machine I wish to use as a host, I have problems. If I use a default.htm file, I have no trouble accessing the site. However,...
2
by: Jim Heavey | last post by:
I am trying to figure out how to "deal" with placing the connection string into the webconfig file when the connection string contains " and '. Here is my connection string... //...
1
by: brian | last post by:
I have a webconfig file in my root directory in IIS with session state set for 100 minutes. All login information is stored in session variables for the site. I have a page that is used by our...
2
by: G. Dean Blake | last post by:
We currently distribute a web application to serveral servers for a customer. We have been putting the connection string in our web.config file under <appSettings> <add...
1
by: rapaka.srinivas | last post by:
Hi i am having a problem with dynamic webconfig.What i am doing exactly is i am calling a fucntion in app_start event that will fetch connection string from my system registry and updates my...
5
by: Paul W Smith | last post by:
My application uses two ways to connect to the Access db: Programtically: Dim sDBPath = "Data Source=D:\MCCL\AccessDB\NewMCCL.mdb;" Dim sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;" &...
1
by: kingsep11 | last post by:
hi I am doing project under entire architecture in ASP.Net ,, But i am getting coonection error while running the program connection at webconfig is below: <appSettings> <add...
4
by: =?Utf-8?B?bWFkaHVzcnA=?= | last post by:
Hi, Could anyone suggest me an idea to encrypt the webconfig file's connection string in the framework 1.1. Thank you in Advance -- Lets Learn and Make All Learn
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.