Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 11th, 2007, 01:20 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default Connection string

hello to all

i am using sql helper class. while executing the sql insert statement i am writing the syntax as

SqlHelper.ExecuteNonQuery(ConfigurationSettings.Ap pSettings["ConnectionString"], CommandType.Text, sqlInsert);

my this query goes to sql helper class there i found i am not getting the value of connection string which is in web.config file.

please guide me what i am writing wrong as i am not passing the connection string.

my query is right as well as i am not getting the ConfigurationManager.Appsetting in my intellisense.



regards,

Munish Bhatia



thanks......
__________________
thanks......
  #2 (permalink)  
Old May 11th, 2007, 05:36 AM
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote: am not getting the ConfigurationManager.Appsetting in my intellisense.
import the namespace as
using System.Configuration;

Regarding not getting web.config value, please check for exact name in the web.config file...



Regards
Mike

Fortune favours the brave, so don't regret on missed oppurtunities.
  #3 (permalink)  
Old May 15th, 2007, 02:03 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

hello mike thanks to suggest. i found my problem as i was using wrong syntax.i am to use:
ConfigurationManager.Connectionstring..........

thanks


thanks......
  #4 (permalink)  
Old May 15th, 2007, 03:15 AM
Registered User
 
Join Date: Feb 2007
Location: Madison, SD, USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to condescendent Send a message via Yahoo to condescendent
Default

I have a good example for ConfigurationManager.Connectionstring..........

it's correct and you can read for experience.


<WebMethod()> _
    Public Function getPrice(ByVal productid As Integer) As DataSet

        Dim conn As New Data.SqlClient.SqlConnection(ConfigurationManager. ConnectionStrings("AdventureWorksConnectionString" ).ConnectionString.ToString())
        Dim myDataAdapter As SqlDataAdapter
        Dim myDataSet As DataSet
        Dim cmdString As String = "Select ListPrice From Production.Product where Production.Product.ProductID =" & productid



        myDataAdapter = New SqlDataAdapter(cmdString, conn)

        myDataSet = New DataSet()
        myDataAdapter.Fill(myDataSet, "Price")


        'price = datareader

        'conn = New SqlConnection("Server=localhost; uid=sa; pdw= ; database=AdventureWorks ")


        'Page(1029)


        Return myDataSet
    End Function


I am a database programmer and .Net programmer
  #5 (permalink)  
Old May 16th, 2007, 05:50 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks for a example.

thanks......
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection String jmss66 Oracle 4 August 8th, 2006 03:19 AM
Connection String slgknjn VB Databases Basics 2 February 26th, 2005 03:14 AM
Connection String fs22 Classic ASP Databases 3 August 30th, 2004 01:25 AM
Connection string tlamazares SQL Server ASP 1 March 29th, 2004 05:16 PM
Connection String Help. diamond2165 BOOK: ASP.NET Website Programming Problem-Design-Solution 1 November 7th, 2003 06:09 AM



All times are GMT -4. The time now is 02:00 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.