Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 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
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 8th, 2007, 02:58 AM
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default The BeerHouse 'Connection String Error'

The Error appeared 'R-0699539F8F\SQLExpress' stating that "unrecognized escape sequence"
Why this error is there while it is working in vb.net???

SqlConnection con = new SqlConnection();
                con.ConnectionString = "Server=R-0699539F8F\SQLExpress;Initial Catalog=TheBeerHouse;Integrated Security=true";
                SqlDataAdapter da2 = new SqlDataAdapter((" select OrderID, AddedBy, AddedDate, ShippingMethod, ShippedDate, Subtotal, Shipping, ShippingFirstName, ShippingLastName, ShippingStreet, ShippingPostalCode, ShippingCity, ShippingState, ShippingCountry, CustomerEmail, CustomerPhone, CustomerFax from tbh_Orders where OrderID = (select Max(OrderID) from tbh_Orders)"), con);
                SqlDataAdapter da = new SqlDataAdapter((" Select OrderID, OrderItemID, Title, TitleA, SKU, UnitPrice, Quantity from tbh_OrderItems where OrderID = (select Max(OrderID) from tbh_OrderItems)"), con);
                DataSet myds = new DataSet();
                da2.Fill(myds, "Orders");
                da.Fill(myds, "OrderItems");
                DataRelation rel = myds.Relations.Add("MyRelation", myds.Tables[0].Columns["OrderID"], myds.Tables[1].Columns["OrderID"]);
                rel.Nested = true;
                myds.WriteXml("c:\\NestedXml.xml", XmlWriteMode.IgnoreSchema);


Reply With Quote
  #2 (permalink)  
Old March 21st, 2007, 02:28 AM
Registered User
 
Join Date: Mar 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

u forgot the following statement after the SqlConnection con...... statement

con.Open()

Reply With Quote
Reply


Thread Tools
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
Error msg: Invalid connection string attribute cJeffreywang ASP.NET 2.0 Basics 3 April 28th, 2008 12:40 PM
Connection String error in ASP picky Classic ASP Databases 1 October 19th, 2007 08:37 AM
Connection string MunishBhatia ASP.NET 2.0 Professional 4 May 16th, 2007 06:50 AM
Connection String phungleon Dreamweaver (all versions) 1 February 11th, 2004 05:14 AM
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 11:10 PM.


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