473,564 Members | 2,730 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connection string problem.

24 New Member
+ ex {"The name \"CHARACTER\ " is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted."} System.Exceptio n {System.Data.Sq lClient.SqlExce ption}
+ dr {System.Data.Da taRow} System.Data.Dat aRow
dr[1] "CHARACTER" object {string}
dr[2] "NAME" object {string}
dr[3] "14/09/2006 12:00:00 AM" object {string}
dr[4] "" object {string}
dr[5] "1" object {string}
dr[6] "1" object {string}
dr[7] "1" object {string}
dr[8] "" object {string}
dr[9] "" object {string}
dr[10] "80" object {string}
dr[11] "False" object {string}
dr[12] "" object {string}
dr[13] "" object {string}
dr[14] "" object {string}
dr[15] "" object {string}
dr[16] "True" object {string}
dr[17] "False" object {string}
dr[0] "1" object {string}
edtProjectName. Text.Trim() This expression causes side effects and will not be evaluated string
+ ex {"The name \"CHARACTER\ " is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted."} System.Exceptio n {System.Data.Sq lClient.SqlExce ption}



public ProjectToDB(str ing _projectDBName)

{

projectDBName = "RG_ProjectData _"+_projectDBNa me;

conn = new SqlConnection(" Initial Catalog=????;Da ta Source=10.1.1.9 9;user id=sa;password= Password123");

}

???this needs to be placed by projectDBName
Oct 2 '06 #1
1 5218
anishs
1 New Member
string projectDBName = "pubs";
SqlConnection objconn = new SqlConnection(" Initial Catalog=" + projectDBName + @";Data Source=192.168. 1.1;user id=sa;password= passwd123");

+ ex {"The name \"CHARACTER\ " is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted."} System.Exceptio n {System.Data.Sq lClient.SqlExce ption}
+ dr {System.Data.Da taRow} System.Data.Dat aRow
dr[1] "CHARACTER" object {string}
dr[2] "NAME" object {string}
dr[3] "14/09/2006 12:00:00 AM" object {string}
dr[4] "" object {string}
dr[5] "1" object {string}
dr[6] "1" object {string}
dr[7] "1" object {string}
dr[8] "" object {string}
dr[9] "" object {string}
dr[10] "80" object {string}
dr[11] "False" object {string}
dr[12] "" object {string}
dr[13] "" object {string}
dr[14] "" object {string}
dr[15] "" object {string}
dr[16] "True" object {string}
dr[17] "False" object {string}
dr[0] "1" object {string}
edtProjectName. Text.Trim() This expression causes side effects and will not be evaluated string
+ ex {"The name \"CHARACTER\ " is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted."} System.Exceptio n {System.Data.Sq lClient.SqlExce ption}



public ProjectToDB(str ing _projectDBName)

{

projectDBName = "RG_ProjectData _"+_projectDBNa me;

conn = new SqlConnection(" Initial Catalog=????;Da ta Source=10.1.1.9 9;user id=sa;password= Password123");

}

???this needs to be placed by projectDBName
Oct 16 '06 #2

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

Similar topics

6
7259
by: Paul Robinson | last post by:
I am developing a website in ASP that connects to a Sybase database. However, when I try to open a connection to the database the page will not load. The script does not timeout, nor the connection. Further, the Sybase server shows no connection. Because the page is hanging I am unable, with my limited knowledge, to query the error collection....
17
3228
by: AMC | last post by:
Hi, I'm using an include file to store the connection string to a database. Whenever I try to reference that string to open a connection in the page that includes the file I get the error 'empy connection string' . When I write the string to the page using response.write(connectionstring) it shows up fine. Is the something else that I need...
0
5361
by: Bob | last post by:
I have an ASP.NET web application that has been running without any problems for a while. I recently transferred the site to shared hosting and had multiple users start to use the site. The problem I'm experiencing is that when many users are hitting the site at once, occasionaly I will see errors. The 3 most common ones are: "The SqlCommand is...
4
4138
by: Rahul Anand | last post by:
Getting SQL Exception when trying to implement Connection based Trasaction using SQL Helper class. I am using the follwing function to execute my stored procs: -=-=-=- ExecuteScalar(ByVal transaction As SqlTransaction, _ ByVal spName As String, _ ByVal ParamArray parameterValues() As Object)
6
17713
by: Bala Nagarajan | last post by:
Hello, I am using Oracle 9i in my application and facing a problem with the connection string. In the datasource attribute of the connection string i had to specify an entry in "tnsnames.ora" file for it to work correctly. If i copy and paste the entry in the "tnsname.ora" file it complains the connection string is too long. I want to avoid...
14
3485
by: WebMatrix | last post by:
Hello, I have developed a web application that connects to 2 different database servers. The connection strings with db username + password are stored in web.config file. After a code review, one developer suggested that it's a security flaw; therefore connection strings should be kept somewhere else or encrypted. My argument is that...
2
5097
by: RyoSaeba | last post by:
Hello, I have a problem with the session state set to Sql Server (AspNet 1.1, Windows Server 2003 on an Application Center cluster, Sql Server 2000 on another server). Sometimes, when many user are using the application, we got this error: "System.Web.HttpException: Unable to connect to SQL Server session database....
20
3253
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how many connection has been used ? 2. If the maximum pool size has been reached, what happens when I call the method Open to open the connection ? Will I...
3
1985
by: Harry Strybos | last post by:
Hi All I have a really strange problem occurring in my application. When I read in the application settings for connection strings the following happens: Here are my connection string settings - <connectionStrings> <add name="TRM8.UI.My.MySettings.TRM8" connectionString="Data Source=SQLDATA;Initial Catalog=TRM8_PROD;Integrated...
0
7666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7644
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7951
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2083
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.