I am now in a problem to prompt user at the first run of my program. The Server is msSql Server 2008 R2 and Plaform vb.Net 2010. At the time of starting, the program starts to search the file, where the ConnectionString is saved. If it get then well else prompt to the user to get help to make the connection string. User will choose the followings 1) Server / Host Name. 2) Windows Authentication or SQL Server Authentication 3) Database Name. 4) User Name & Password (For Server) I am not understand where from I call it and how …

Member Avatar
Member Avatar
+0 forum 4

Hi Guys I have an asp.net application developped using C# asp.net 4.0 , It is running perfectly with .net inbuilt server , but it throws an exception when running on IIS server 5.1 (Win XP sp-3) There i have a connection string encryption method , that is the place it throws the exception any body no an idea to sort out this issue private void EncryptConnstring() { Configuration config = WebConfigurationManager.OpenWebConfiguration("~"); ConnectionStringsSection constrsec = (ConnectionStringsSection)config.GetSection("connectionStrings"); constrsec.SectionInformation.ProtectSection("DataProtectionConfigurationProvider"); config.Save(); }` <configuration> <connectionStrings configProtectionProvider="DataProtectionConfigurationProvider"> <EncryptedData> <CipherData> <CipherValue>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA/UYu3PJMHE+dbcAnqpdQZQQAAAACAAAAAAADZgAAqAAAABAAAABfRyTE1R2Qx1TfIRfGIRC+AAAAAASAAACgAAAAEAAAAADBnHaL/dOqgKh1L/imlIuIAQAAlajBlxThs+ygnm7Y0dmb6o9p5PWzb6Vyc8f6KEFAJPJgfCmKjUz/ak2VafQRFfFZYMWiIcs38FeXhl5JtRg1A+Wll/Kh6cOJK+fjKS4UTJ6+nWY6UfnFZzlJUqMfIGIyyRfkzAxNobBpY08SVCNPwwSDizYMXLSnIVaE3b2VHK2o8IW/Rl1p8N4QDltFgeqFuNX8ysqnphpf4MHJuEE/MHpN5RV9zqSfpN6FCEcqseaWI7r5BsXaZn32uR8RKV6zAIAzjSF6Nl/wFUalouu/PDJEouP7yJjs74bjgsJVkZoVSHVnfybrcsyClly1CoIevnG4DwbGHLlGQbKOYtDmzR9uA6LGZqnL3im9OjxqvNG8k7B07LZrmITCBcdaK6uKNBQpjRuSFN6G9nFl/CL7yk+epL9QWF9SS7Z2IEZ9cr2EI1pJ2XcyP7cWJbkzAyzvGivwFTFwwrGkXMkMmNdKAcQhKDGmkLAcpk6v0fExY2uvrOn8RvvfH86hpnSO+08VNauTC4NprtcUAAAAHSPGE+6ROzfqNi8ZaCo01o3yRWA=</CipherValue> </CipherData> </EncryptedData> </connectionStrings> thanks regards sumith

Member Avatar
+0 forum 0

Hello everyone! I am posting this code for anyone who may be having issues with connecting to a database. Feel free to use this code as you wish. This will be using the OLEDB library. [CODE] 'Imports Imports System.Data.OleDb Public Class Form1 'Declarations Dim con As OleDbConnection Dim cmd As OleDbCommand Dim sqls As String Dim sqlcmd As String Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load 'In form_load event, but can be used on button click. 'For hard coded connection string sqls = "Provider=SQLOLEDB;Datasource=YOURSERVERNAMEHERE;" & _ "Initial Catalog=YOURDATABASENAMEHERE;Integrated Security=SSPI" 'For dynamic connection string sqls = "Provider=SQLOLEDB;Datasource=" & …

Member Avatar
Member Avatar
+2 forum 5

I have developed a windows application. My development environment is win7, office2007, C#, VS2010, Winforms. My application stores data in MS Access. Is there any way with which i can create a connection string based on Oledb driver version present in PC?

Member Avatar
Member Avatar
+0 forum 1

I am working on a VS2010 Winform (not ASP web form). I have a copy of the local database on my computer. In this application, I have 3 forms in my application that need to connect to the same database, but different tables. Right now I am defining my connection string in each form something like this: private string ConnString = "Data Source=(local);Initial Catalog=Inspections;Persist Security Info=True;User ID=MyUser;Password=MyPassword"; After I work on my project locally, I need to change it to use the real database on one of our SQL servers, so I change the string in all three forms. I …

Member Avatar
Member Avatar
+0 forum 2

Hello, I m new in asp. I need to run asp website with access database. Pls help me to do this.. i got problm with connection string i think. Broswer reply : ------------------------------------ Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides. /flex/include/system.asp, line 10 ---------------------------------------- Please help me to solve this. Jack parsana

Member Avatar
Member Avatar
+0 forum 1

I was wondering if there is a way to open an SQL file and execute it from a c# application without prior connection to a database and also get the name of the default server that is used when SSMS is opened. at the moment i can open SSMS but i can't for the life of me figure out how to get the server name as well as opening and running an SQL file which is a DB creation script. The reason i ask is because i've been trying to add a function, that will run if there isn't a …

Member Avatar
Member Avatar
+0 forum 5

I have the following code for connecting to an Oracle DB [code] using Oracle.DataAccess.Client; // C# ODP.NET Oracle managed provider OraDb= (DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=ORASRVR)(PORT=1521)) ) (CONNECT_DATA= (SERVER=DEDICATED) (SERVICE_NAME=ORCL) ) ) string oradb = "Data Source=//192.168.100.108;User Id=hr;Password=hr;"; // C# string oradb = "Data Source=(DESCRIPTION=" + "(ADDRESS=(PROTOCOL=TCP)(HOST=ORASRVR)(PORT=1521))" + "(CONNECT_DATA=(SERVICE_NAME=ORCL)));" + "User Id=hr;Password=hr;"; OracleConnection conn = new OracleConnection(oradb); // C# OracleConnection conn = new OracleConnection(); // C# conn.ConnectionString = oradb; conn.Open(); // C# string sql = " select department_name from departments where department_id = 10"; // C# OracleCommand cmd = new OracleCommand(sql, conn); cmd.CommandType = CommandType.Text; conn.Close(); // C# conn.Dispose(); // C# [/code] …

Member Avatar
Member Avatar
+0 forum 1

Okay, So I have an application which uses MSSQL server as datasource. Is there anyways I can avoid using any database server and use a local file as datasource ? If yes , what are options. AND HOW ? PS: this is very important guys. please help. THANK YOU.

Member Avatar
Member Avatar
+0 forum 4

I have this OLEDB connection string connectionstring as string = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _ data.toString & ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=2 I just want to know what is the meaning of HDR and IMEX, and what are their purpose on the connection string Thanks..

Member Avatar
Member Avatar
+0 forum 1

hi, i have a project written in visual studio 2008. and i copied the folder to the network drive. and from another pc when i run the exe file of the application an error occurs because the connection string is different, how can i make the application which is in the network drive to access the mdf file in another computer(where the application was created) how can i change the connection string so that it can access the original mdf file??? can some one give me some guidelines thaxx appreciate a lot thaanxxxx

Member Avatar
Member Avatar
+0 forum 9

Hello, I have one more question. I am connectinag to SQL Server 2008, not express, and I keep getting the "login failed for user "..."" The connection string I am using is: [CODE] Dim connStrg As String = "Data Source=" _ & ServerAdressTextBox.Text & _ ";Initial Catalog=" & _ DatabaseNameTextBox.Text & _ "Integrated Security=SSPI" & ";" [/CODE] Does anyone know where I am going wrong? If anyone knew anything that could help point me in the right direction, it would be GREATLY appreciated. Thank you all for your time.

Member Avatar
Member Avatar
+0 forum 7

I'm trying to connect a SQL database to a Classic ASP site. I keep getting the following error message no matter what I do: ADODB.Connection error '800a0e7a' Provider cannot be found. It may not be properly installed. I have an ODBC entry for this database, as well as have the following connection info in the file (although I've changed some of these for security b4 posting here): [CODE] Set objConn = Server.CreateObject("ADODB.Connection") objConn.ConnectionString = "Provider={SQL Server};Server=server;Database=db;User ID=id;Pwd=pw" strSQL = "SELECT * FROM table" objConn.Open strSQL, objConn [/CODE] Can someone please point out where I'm amiss as I've been going through …

Member Avatar
Member Avatar
+0 forum 3

i have a private sub that reads 4 lines of data from a text file, and then uses whats read and stores them in varibles. see below [CODE] Dim FileName As String = configfileV Dim TextFromTheFile As String ' Whole text Dim Lines() As String ' File splitted to lines Dim LineSeparator() As String = {Environment.NewLine} ' Line separator 'character' ' Use My namespace If My.Computer.FileSystem.FileExists(FileName) Then ' Read the file TextFromTheFile = My.Computer.FileSystem.ReadAllText(FileName) ' Get lines. I used StringSplitOptions that removes empty lines Lines = TextFromTheFile.Split(LineSeparator, System.StringSplitOptions.RemoveEmptyEntries) ' Now you have Lines() array ready ServerV = Lines(0).Substring(Lines(0).IndexOf("="c) + 1) …

Member Avatar
Member Avatar
+0 forum 10

This is my first foray into the world of programming. I'm doing a practice project for the consulting firm I work for, and my current objective is to make my submission page textboxes insert the user input into specific tables in my database. Later I'll need to retrieve the data, but for now it suffices to get the data to go where it's supposed to. Why won't the data go into it's home? Doesn't it like it's home? My code is below. I'm working with VS2010, code behind in C#, with SQLEXPRESS 2005. When I debug, punch in sample input …

Member Avatar
Member Avatar
+0 forum 1

Hi guys, I'm new here and in dire need of help for a problem that I've worked on hours. I created a table 'tblProductCat' in the webform and wanted to populate the table with the code below: [CODE]Imports System.Data Imports System.Data.SqlClient Partial Class ProductCategories Inherits System.Web.UI.Page 'Define DA and DS here Dim dataAdapter As New SqlDataAdapter Dim dataSet As New DataSet Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim pointer As Integer = 0 Dim ConnectionString As String = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\FitXdb.mdf;Integrated Security=True;User Instance=True" Dim connection As New SqlConnection(ConnectionString) connection.Open() Try 'Assign table to dataAdapter at …

Member Avatar
Member Avatar
+0 forum 2

Hi! I need to be able to change the location of the database at runtime through a menu in my program. My question is how to best achieve this. If for example the ip to the server change, the user need to be able to update the database path; i.e. change a part of the connectionString. This would be easy to achieve hardcoding the connectionString into the code but I'm not sure if that is the right thing to do since it contains a user and password. Currently I'm storing the connectionString into an app.config file that I've encrypted. Is …

Member Avatar
Member Avatar
+0 forum 3

hi, im about to finish a winform app for a client and I was wondering about the most common ways to handle connection strings. I know you can change the path from within appConfig to whatever the path may be on the destination server but are there any established approaches to allowing the user to define the path themselves at some point? If for example the user wanted to move the database to another machine, is it the standard aproach that they would have to go into the source code and redefine the string? many thanks

Member Avatar
Member Avatar
+0 forum 1

Hello Frends, I have an application where I am trying to connect MS Access DB with a ASP.Net(C#) Page and the same application also connect to the MS SQL Server (Working Fine). While connecting I am having following [B]error:[/B] _____________________________________________________________________________________ [B]Server Error in '/manager' Application. The Microsoft Jet database engine cannot open the file 'C:\Inetpub\vhosts\brightlightremc.com\httpdocs\manager'. It is already opened exclusively by another user, or you need permission to view its data.[/B] Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in …

Member Avatar
Member Avatar
+0 forum 1

How to make clients on sql server i mean when i will install my application on clients how i will connect it with sql server?

Member Avatar
Member Avatar
+0 forum 3

I have been making some changes to an application that uses an ASP.NET Membership services database for authentication. I can access the database locally using windows authentication, and using my SA user. However, after moving the application to the prod. server, I can't access the DB at all. I wrote a simple test-app to test my conn-strings. AuthenticationConnectionString fails. AppDBConnString connects successfully. I can log into management studio using the same user that I'm using in the conn-strings, and can open both databases and execute queries successfully. [CODE] <add connectionString="Server=****\**;Database=FNAuthentication;User ID=***;Password=***" name="AuthenticationConnectionString" /> <add connectionString="Server=***\**;Database=AppDB;User ID=***;Password=***" name="AppDBConnString" /> [/CODE] The …

Member Avatar
+0 forum 0

Hello guys. I'm building an application that connects to a SQL Server 2008 database via connection string. The thing is, since the computer loading the app (or the user, in either case) is outside the Active Directory domain, I can't use Windows Authentication to connect to the DB. But when I include the database credentials, it won't let me connect either, telling me that since the computer logging in is from an untrusted domain, access is denied. The connection string goes like this: [code=vb] connectionString = "Data Source=" + ServerName + ";Initial Catalog=" + DatabaseName + _ ";Integrated Security=SSPI;User ID=" …

Member Avatar
Member Avatar
+0 forum 3

Hello, I am currently working on a project for my degree using asp.net, C# and Sql. The problem I am having is with my connection.cs file that I have created, the code I have is as follows: [CODE] using System; using System.Configuration; using System.Linq; using System.Data.Linq; using System.Xml; using School.SchoolCore.Core.Domain; using School.SchoolCore.Properties; using StructureMap; namespace School.SchoolCore.Core.DataAccess.Impl { public class Connection { public SchoolDataContext GetContext() { string connString = ""; try { XmlDocument doc = new XmlDocument(); doc.Load("ConnectionStringToUse.xml"); XmlNodeList xnl = doc.GetElementsByTagName("environment"); XmlElement xe = (XmlElement) xnl[0]; switch (xe.InnerText.ToString().ToLower()) { case "local": connString = Settings.Default.SchoolConnectionStringLocal; break; case "development": connString = Settings.Default.SchoolConnectionStringDevelopment; …

Member Avatar
Member Avatar
+0 forum 2

Hello Everyone, I have developed an application for website using ASP.NET and SQL Server 2005. Recently I have uploaded it to server, but after uploading its showing the following error message - [B] Login failed for user ''. The user is not associated with a trusted SQL Server connection.[/B] [B]Description:[/B] [I]An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Login failed for user ''. The user is not associated with a trusted SQL Server connection.[/I] I …

Member Avatar
Member Avatar
+0 forum 4

Hi! I want to Upload and Attach my SQL server 2005 database and my Asp .net site to server please help me. and my connectionstring setting is in web.config tank you.

Member Avatar
Member Avatar
+0 forum 2

Right away, Im fairly new to vb.net. Is there a way to have a local db cache that will use a connection string saved in settings? IE: program obviously has a central db remote computers will sync with when connected. can I save the connection string in the program settings so it can be setup in a settings form? I want to enable different companies to use the software on their own servers. Ideas?

Member Avatar
Member Avatar
+0 forum 1

The End.