C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » .NET »

C# .NET + sql Server 2005+ Selecte Query Error


Posted Date: 19 Nov 2008      Posted By: radhika bista      Member Level: Gold     Points: 1   Responses: 1



hi,
I m using MS Sql Server 2005.
Whats the problem with the following code i m getting runtime error
Incorrect syntax near ')'.


Code as Folows:
SqlCommand cmd = new SqlCommand("Select this_id From "+table_name+" Where ((Project_id Like '"+text_project_id.Text.Trim()+"')And(item Like '"+treeView_project.SelectedNode.Parent.Text.ToString().Trim()+"')))", con);
SqlDataReader rd = cmd.ExecuteReader();

Thanks





Responses

Author: Praveen    19 Nov 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

.SelectedNode.Parent.Text.ToString().Trim()+"')))",


see here u kept 3 closing braces as 2 is enough

hope this will help u



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : short cut keys work for crystalreportviewer in windows application
Previous : http request
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use