How Can I Connect To Sqlserver Express Manually When I Use Text Boxed

Feb 27, 2006

hi guys,


i am very happy that i found this forum which discuss ASP.net.
i am new to ASP.net 2.0 and some need serious help. when i debug my application and try to insert data an error occur saying:

"Cannot open database "ecb" requested by the login. The login failed. Login failed for user 'HOME-USERuser'."

the code that i have used to submit data is as follow:

Imports System.Data.SqlClient
...
  Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

      Dim objConn As SqlConnection
      Dim objCmd As SqlCommand



objconn = New SqlConnection("data source= localhostsqlexpress; initial catalog =ecb; persist security info =true; trusted_connection=true")

objCmd = New SqlCommand("INSERT INTO staff (firstname, surname) VALUES (@firstname, @surname,)", objConn)

objCmd.Parameters.Add("@FirstName", Data.SqlDbType.VarChar).Value = txtFirstName.Text
objCmd.Parameters.Add("@Surname", Data.SqlDbType.VarChar).Value = txtSurname.Text

objConn.Open()
objCmd.ExecuteNonQuery()
objConn.Close()


i also used this data connection but didn't help:
objconn = New SqlConnection("Server=localhost; Database=ecb;user ID='  ';Password='  ' ") when i use this data

connection i get this message: Login failed for user ''. The user is not associated with a trusted SQL Server connection.

as far as i can remember i have used windows authentication when creating my database in sql server 200 express edition.

the funny thing is that when i use datagrid wizard or dataform the connection is fine ( i mean is automatically done for me but i don't know when i like to do it manually does not work).

can anyone help? thank you in advanced

View 5 Replies


ADVERTISEMENT

Connection String To Connect To SQLServer Express?

Feb 22, 2006

Hi

I've been trying to get DotNetNuke to connect to a SQLServer Express database but no luck. I've had no luck with info from their forums...

The connection string I'm supposed to use is:

<add
name="SiteSqlServer"
connectionString="Data Source=.SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Database.mdf;"
providerName="System.Data.SqlClient" />

I just can't get it to connect to the database. Says something that remote connections are not allowed. I've done the Area thing and allowed all connection including remote connections.

Can't we use the standard string like:

<add
name="SiteSqlServer"
connectionString="Server=(local);Database=DotNetNuke;uid=;pwd=;"
providerName="System.Data.SqlClient" />

...to connect? I'd like to setup a user and give the username and password in the connection string - real easy and non-complicated...

Any ideas or help?

Andre

View 3 Replies View Related

How Do You Connect To Networked SqlServer 2005 Express Using The Add New Data Source Wizard

Sep 7, 2006

Hi All,

I want to connect to SQLExpress database on the network. I can do so using code but I want to use the Data Source Configuration Wizard. It seems this only works for local instances of SQL server. Is this true?

I can connect just fine to the database on the network using Microsoft SQL Server Management Studio Express...for what this is worth.

I have tried to map a drive to the SQL server machine and pick the mdf file but I get the error msg of network path is not supported for database files....I have turned on allow remote connections, allow tcp/ip, named pipes, added sqlserv.exe and sqlbrowser.exe to my firewall exceptions ect..

I want to be able to use Table Adapters, SqlDataAdapters ect. After reading numerous forum questions/ kb articles this seems to be a common problem. I am on the verge of just saying forget it and use MS Access instead.

Thanks in advance!















View 4 Replies View Related

Failed To Reinstall SQL 2005 Express After Removing It Manually

Nov 30, 2007



got problem with uninstallin sql so i ended both sql exe files in Services and Progresses
then removed c:program filsmicrosoft sql server manually and some keys about sql in registry

when i reinstall,
no problem with
SQL setup support files
SQL Native Client
SQL VVS writer
couldnt pass thru the "SQL Server Database Services" Installation



TITLE: Microsoft SQL Server 2005 Setup
------------------------------

SQL Server æœ?åŠ¡æ— æ³•å?¯åŠ¨ã€‚有关详细信æ?¯ï¼Œè¯·å?‚阅 SQL Server è?”机丛书中的主题€œå¦‚何查看 SQL Server 2005 安装日志文件€?å’Œ€œæ‰‹åŠ¨å?¯åŠ¨ SQL Server€?。
( SQL server services fail to start. For more information ... blah blah blah and Start SQL server manually )


For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&EvtSrc=setup.rll&EvtID=29503&EvtType=sqlsetuplib%5cservice.cpp%40Do_sqlShutDownRANUInstance%40sqls%3a%3aService%3a%3aStart%40x422

------------------------------
BUTTONS:

&Retry
Cancel
------------------------------

when i goto SQL server Configuration Manager, it says:

MMC could not create the snap-in
CLSID: {CA9F8727-31DF-41D2-975C-887D84903967}

View 1 Replies View Related

Should The SQL Server Express Service Start Automatically Or Manually?

May 13, 2008

Hello all,

We are deploying an application using SQL Server Express to a wide variety of desktop and laptop machines. We are currently trying to decide whether we should install the SQL Server instance service to start automatically at startup or not. In the latter case, our application would start and stop the service.

Starting automatically will make our app load more quickly, which is important to our users. However, our support team is concerned that leaving the service running will leave our databases vulnerable to becoming "suspect" if, for example, a laptop user's battery dies suddenly. Of course this will always be a problem if the app is running, but our support team believes that having the service running all the time will increase the chances of this happening. One reason for their concern is that an older version of the software used MSDE which was running all the time, and they saw a good number of suspect database issues.

What is the best practice for leaving the service running, especially when there are a lot of laptop users?


Thanks,
Ben

View 3 Replies View Related

Problem Unicode Data 0x2300 In SQLServer 2000 SQLServer 2005 Express

Sep 20, 2006

Hi experts;
I have a problem with unicode character 0x2300
I created this table
create table testunicode (Bez nchar(128))

Insert Data
insert into testunicode (Bez)values('Œ€„¢')
with 2 Unicode characters
Œ€ = 0x2300
„¢ = 0x2122

Selecting the data
select Bez from testunicode
I see
"?„¢"

„¢ = 0x2122 is ok but instead of 0x2300 there is 0x3f

When I modify the insert statement like that ( 8960 = 0x2300 )
insert into testunicode (Bez)values(NCHAR(8960)+'„¢')

and select again voila i see
"Œ€„¢"
Does anyone have an idea?

Thanks

View 1 Replies View Related

Trying To 'load' A Copy Of A SQLServer 2000 Database To SQLServer 2005 Express

Apr 18, 2008



I am trying to 'load' a copy of a SQLServer 2000 database to SQLServer 2005 Express (on another host). The copy was provided by someone else - it came to me as a MDF file only, no LDF file.

I have tried to Attach the database and it fails with a failure to load the LDF. Is there any way to bypass this issue without the LDF or do I have to have that?

The provider of the database says I can create a new database and just point to the MDF as the data source but I can't seem to find a way to do that? I am using SQL Server Management Studio Express.

Thanks!!

View 1 Replies View Related

Replacing Sqlserver 2000 With Sqlserver 2005 Express

Jun 14, 2006

I have an app that uses a sqlserver 2000 jdbc driver to connect to a sqlserver 2000.

Is it possible to do a direct replacement of sqlserver 2000 with sqlserver 2005 express just by reconfiguring the app to point to the express? The app would still be using the sqlserver 2000 jdbc driver to try and make the connection.

If that is a possibility, what can be some differences in the configuration? Previously with 2000 the config information I entered is:

server name: "machinename"( or ip). I've also tried "machiname/SQLEXPRESS"

DB name: name of db instance

port: 1433(default)

user and pass.

My attempts so far results in

"java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket."

and

"java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unable to connect. Invalid URL."

View 1 Replies View Related

Post Update For SQLServer SP2--is There One For SQLServer Express?

Apr 18, 2007

Regarding KB935356, is there a "post" service pack 2 update for SQLServer Express?



Thanks.

View 7 Replies View Related

Cannot Connect W/ Java App But Can Connect W/ .Net App - SQL Server Express 2005

Dec 12, 2006

I'm having a problem connecting with a Java application but I CAN connect using my .Net application - the user name and password are the same for both (using the same database on SQL Server Express 2005).

The error I get is: "com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open database "CORNERS" requested by the login. The login failed." An interesing note - I get the same message if the database is not running.

SQL Server Express 2005 is installed in mixed mode.

Here is my connection string in the .Net appplication: <add key="connectString" value="Server=(local);UID=sa;PWD=myPasswd;Database=CORNERS" />.

These are my values in my Java app web.xml -

<init-param>
<param-name>DBDriver</param-name>
<param-value>com.microsoft.sqlserver.jdbc.SQLServerDriver</param-value>
</init-param>
<init-param>
<param-name>DBURL</param-name> <param-value>jdbc:sqlserver://localhostsqlexpress:1055;databaseName=CORNERS</param-value>
</init-param>
<init-param>
<param-name>DBUser</param-name>
<param-value>sa</param-value>
</init-param>
<init-param>
<param-name>DBPwd</param-name>
<param-value>myPasswd</param-value>
</init-param>.

And yes, the port is 1055 - I checked to find it.

I am using Microsoft SQL Server 2005 JDBC Driver 1.0 (sqljdbc_1.0.809.102).

Does anyone have any idea what is wrong so that the login fails in the Java application but works in the .Net application?

View 7 Replies View Related

Connect Sqlserver

Oct 16, 2007

i can't connect sqlserver from client pc
please help me >>>>>>>>>>>>>>>>>>

hi all

View 1 Replies View Related

Sqlserver Does Not Connect

Feb 17, 2006

when sqlcmd -s serverinstance cmd is given it geves an error that "under default settings sql server does not allow remote connections login timeout expired"

why sql browser not running

pls help

View 1 Replies View Related

Cannot Connect To SQLServer 2005

May 14, 2007

After several attempts to install SQL2005 I finally got Microsoft SQL Server Management Studio installed.But now I get the error below:An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)The sa account username/password are correct and don't work, windows authentication does not work, I have stopped/started all the services, I have all Protocols enabled correctly, I have my Firewall turned off. Is there anything else I can try? Anything! 

View 1 Replies View Related

Attempting To Connect To SQLServer 2k

Aug 9, 2004

This is the code I'm using on the web page located on the server:

Dim strConn as String
Dim conn as SQLConnection
strConn="server=localhost;Trusted_Connection=Yes;database=CIS"

conn=New SQLConnection(strConn)
conn.Open()

and the error messgae I receive is: Login failed for user 'MSP00427ASPNET'.

msp00427 is the name of the server
= = = = = = = = =

I have an MSAccess application that accesses the same database as follows with no trouble.

glblConnectString = "Driver=SQL Server;Server=msp00427;Database=CIS;Trusted_Connection=Yes"

Set cnn = New ADODB.Connection
cnn.Open glblConnectString
Set cmd = New ADODB.Command
cmd.ActiveConnection = cnn
cmd.CommandText = "Scorecard_Delete_ATLASDataDump"
cmd.CommandType = adCmdStoredProc
cmd.Execute

This is run on my PC and I have sa capabilities on the server.

The .NET framework is installed.

Any ideas why the data access on the web page fails?

View 3 Replies View Related

Can I Connect Asp 1 To Sqlserver 2005

Oct 18, 2005

Hi All,I hopen this isnt a stupid question but can I connect asp 1 to sqlserver 2005? i want to update the database used on a ASP.net 1 project, I seem to be able to get it to connect but cant get it to see the tables?Thanks for any helpLee

View 5 Replies View Related

Unable To Connect To Sqlserver

Dec 31, 2007

unable to connect to sqlserver, server not found error ... i typed the right username and password,,, still i am not able to connect to sqlserver ,,also i tried with new sqlserver registration still i am not able to connect to sqlserver

error :

specified sqlserver not found connection connect()

please help me out

View 2 Replies View Related

I Cannot Connect To SQLSERVER Database

Jul 23, 2007

In SQLserver Admin, ANDONASPNET is setup as a 'Server Admin'



****************************************************************************

Connection string is set in the web.config file.

<configuration>



<connectionStrings>

<add name="SqlServerEx"

connectionString="Data Source=LOCALHOSTSQLEXPRESS;Initial Catalog=DB2;Integrated Security=SSPI;"

providerName="System.Data.SqlClient;"></add>

</connectionStrings>



<appSettings/>



<system.web>

.......................................................................







protected void Button2_Click(object sender, EventArgs e)

{

string connStr = WebConfigurationManager.ConnectionStrings["SqlServerEx"].ConnectionString;

SqlConnection con = new SqlConnection(connStr);

TextBox3.Text = connStr;

try

{

con.Open();

TextBox2.Text = "<b> Server Verison::</b>" + con.ServerVersion;

TextBox2.Text += "<br /><B>Connection Is::</B> " + con.State.ToString();

}

catch (Exception err)

{

TextBox2.Text = "Error reading Database. ";

TextBox2.Text += err.Message;

}

finally

{

con.Close();

TextBox2.Text += "<BR><B>CONNECTION::" + con.State.ToString() + "</B>";

}

}

****************************************************************************



This is the error message I am getting:

"Error reading Database. Instance failure."

View 1 Replies View Related

If All What I Used Is The Express Version - Is It Possible To Connect And Use The Sql.s Express Form The Vs. Express

Apr 14, 2008


Hello
I got a sql server express that i am trying to connect form win or web forms(2.0) €“ express as well.

My problem:
Can not connect to the server in any way!
Even the designer cont find any sql server on my machine; for example "the data source configuration manager" (gui) in enyn way its can not find the sql server express (2005)

So my question is:
if all what i used is the express version - is it possible to connect and use the sql.s express form the vs. express

View 10 Replies View Related

Connect To SqlServer 2005 With Odbc

Feb 28, 2008

Hi all,
I'm not a db guru and probably this is a very simple question for you, but I was wondering if it was possible to connect to a SqlServer using odbc without DSN.
I mean, I'm trying to connect to the db server from a linux (Fedora Core 8) workstation, using odbc drivers, but it looks like I can do that only using a DSN connection and setting properly the odbc.ini file. It doesn't work, if I use a connection like this from a PHP script:
$cn = odbc_connect("Driver={SQL Server};Server=MyServer;Database=MyDatabase",
"MyUser","MyPassword")
Does anyone know how to connect to SqlServer with a DSN-less connection? Could you explain me where is the error?

I'm using SQLServer2005, Fedora Core 8 with the last FreeTDS installed.

Please help!

Thanks million in advance.

View 7 Replies View Related

Failed To Connect To Sqlserver 2005

Jun 25, 2007

Hi
im trying to connect to sqlserver 2005 using windows authentication and gives me this error "Login failed for user ''. The user is not associated with a trusted SQL Server connection."
any help

thanks in advance.

View 3 Replies View Related

When I Connect SqlServer Db I Got The Specified Network Name Is No Longer Available.

Dec 28, 2007



Hi.
i got an error when i connect to sqlserver 2005 db with use of Sqlserver ManagementStudio.

A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.) (.Net SqlClient Data Provider)(Microsoft Sql Error - 64)...

View 4 Replies View Related

Connect To Sqlserver By Sqlconnection From Windows CE 5.0

Feb 6, 2007

Currently I cannot connect to a database, I got the system.exception €œPlatformNotSupportedExcoption€?. This database is Polish (COLLATE Polish_CI_AS), when I collate this database to latin general it works fine. I connect by using the system.data.sqlclient.sqlconnection, as far as I can see I cannot set the locale identifier here€¦ What can I do???
Thanks for your help!
regards, Jan

View 3 Replies View Related

Error When Connect To Sqlserver From Another Machine

Nov 17, 2006

hi ..

i install sqlserver and make app with vb6 using ADO to connect to the database and successfully

i put that application on another pc on the network
when i open it it says "can't login computernameguest" ??!!

any help

thanks in advance.

View 10 Replies View Related

How To Connect To My Web-Site'SqlServer Through Enterprise Manager?

Aug 19, 2006

Hi all,
I have Sql Server 2000 installed in my home and also i have a website that works with Sql Server2000 and .Net FrameWork v1.1 ,now i want to know is it possible to connect from my home SqlServer to Host SqlServer( where my Website resides )  through Enterprise manager or Query Analizer to do some data-manipulation And how?
Thanks in advance.Regards.
 

View 1 Replies View Related

Why Can't I Connect To SQLServer With An Incomplete Conn. String ?

Dec 23, 2004

I found out that I could use SQLDMO to enumerate objects in a SQL server. However, I can't connect to my server, even though I have both "windows and SQL server" authentication on "(local) Windows NT".

Here is the code (it does not contain the validation in this snippet):


Imports System.Data.SqlClient
Imports SQLDMO

Public Class ADO_2
Inherits System.Web.UI.Page
Protected WithEvents txtQuery As System.Web.UI.WebControls.TextBox
Protected WithEvents txtresults As System.Web.UI.WebControls.TextBox
Protected WithEvents lstDB As System.Web.UI.WebControls.DropDownList
Protected WithEvents lblResult As System.Web.UI.WebControls.Label
Protected WithEvents cmdExecute As System.Web.UI.WebControls.Button
Protected WithEvents cmdNext As System.Web.UI.WebControls.Button

Private m_objConn As New SqlConnection()
Private m_objSQLServer As SQLDMO.SQLServer

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

EnumerateDatabases()

'TEMP
lstDB.Items.Add("Northwind")
lstDB.Items.Add("Pubs")
'END TEMP
End Sub

Private Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Unload

m_objConn.Close() 'Just in case.....
End Sub


Private Sub cmdExecute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExecute.Click

Dim objCommand As SqlCommand
Dim objDataReader As SqlDataReader
Dim intField As Integer

txtresults.Text = String.Empty
m_objConn.ConnectionString = "server=radu;database=" & lstDB.SelectedItem.Text & ";integrated security=SSPI;"
m_objConn.Open()

objCommand = New SqlCommand(txtQuery.Text, m_objConn)
objDataReader = objCommand.ExecuteReader

While objDataReader.Read
txtresults.Text &= vbNewLine
For intField = 0 To objDataReader.FieldCount - 1
txtresults.Text &= objDataReader(intField).ToString.PadRight(15)
Next
End While

objDataReader.Close()
objDataReader = Nothing
objCommand = Nothing
m_objConn.Close()

End Sub

Private Sub EnumerateDatabases()

On Error GoTo EnumerateDatabasesError

Dim objSQLDatabase As SQLDMO.Database

m_objSQLServer = New SQLDMO.SQLServer()
m_objSQLServer.Connect("radu")

'Iterate through all databases on the target server:
For Each objSQLDatabase In m_objSQLServer.Databases
lstDB.Items.Add(objSQLDatabase.Name)
Next objSQLDatabase

EnumerateDatabasesExit:
objSQLDatabase = Nothing
m_objSQLServer.Close()
m_objSQLServer = Nothing
Exit Sub

EnumerateDatabasesError:
lblResult.Text = Err.Number.ToString & ", " & Err.Description
Resume EnumerateDatabasesExit
End Sub
End Class


Why can't I connect with m_objSQLServer.Connect("radu") ? I also tried m_objSQLServer.Connect("radu", "", ""). Otherwise, I can connect just fine with m_objConn.Open() (after I select a db from the dropdownlist, which is for now populated by hand)....

Thanks a lot for your time.

Alex.

View 1 Replies View Related

Can't Connect To DB When SqlServer Exp Has Been Idle For A Couple Hours.

Mar 13, 2008

Does SQLServer go to sleep when it's been idle? How can I connect without an error?

I have SQLExpress on a server. Server Name is SqlExpress. I have 2 DBs on that server... Tuna & Guppy. I'm connecting to the DBs from a remote PC which runs my App... an exe created with Visual Studio 2008, Visual Basic.

If I run my App at say 9:30PM, after the server has been idle for several hours, I get a "Can't open connection to Guppy" error, which is my error message when the connection attempt fails. If I quit & relaunch the app, it connects fine, and will continue connecting fine unless you leave the server idle for serveral hours again.

If I'm developing a 2nd app all evening... which connects to a 2nd DB...Tuna, that activity seems to keep the SqlServer awake and then launching the 1st app at 9:30PM connects to Guppy just fine.

I tried adding a "Connection Timeout=30" to my connection string but that did not help.

My connection code is as follows (note the server's name is SQLExpress):

Dim strConnG As String = "Data Source=SQLEXPRESSSQLEXPRESS;Initial Catalog=Guppy;Integrated Security=True;Connection Timeout=30"
Using ConnG As New SqlConnection(strConnG)
'open Guppy connection
Try
ConnG.Open()
Catch ex As Exception
MsgBox("Can't open connection to guppy")
Return False
End Try
'Code that does stuff
End using


Can anyone tell me how to fix this so I can connect without error, even if the server has been idle?

Thank you,

Joe A

View 6 Replies View Related

Unable To Connect To Sqlserver 2000 From Sqlserver2005

Sep 10, 2007



Hi,

iam having vs2005 installed on my machine and i also installed sqlserver2005 dev edition on my machine...Unable to connect to Sqlserver 2000 which is installed remotely ....Sqlserver2000 is dev edition.i cudnot find Sqlserver2000 instance when i try to search for Network database engine name .......

I feel to know how to enable remote connection on Sqlserver 2000.So tht i can access this sqlserver2000 from another machine

View 1 Replies View Related

I Can No Longer Connect To My SQL Server Express 2005 From Manager Studio Express

Sep 28, 2006

Everything was working fine. I have been able to connect using windows authentication. Then, I went into the ODBC manager to add a data source and it failed to connect so I went back into the Server management studio to modify users. After doing this I now get an error when I try to conenct the management studio to the SQL server.

I wasn't modifying the login for my windows account that I normally use, I was modifying a different one, however I now get the message "An error has occured while establishing a connection to the SQL server. This kind of problem can ocure because the default behavior of the server does not support all connection methods" blah blah.

Does anyone know how I can attach to the server? Or, do I need to somehow remove the server and create a new one? How would I do that?

Thanks in advance for any input.

View 1 Replies View Related

Can't Connect To SQL 2005 Express With SQL Server Management Studio Express

Mar 10, 2006

I've seen the following error posted when people try to connect to their server via their applications but didn't see anyone having problems when trying to connect with SQL Server Management Studio Express. Am I missing something here? This is the error:<<An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)(Microsoft SQL Server, Error: 2)>>The server is not remote so I don't see why I need to enable remote connection. I am also using the default connection settings.

View 3 Replies View Related

Cannot Connect To SQL Server 2005 Express With Management Studio Express

Feb 24, 2007

On my home machine without permanent network connections enabled, I cannot get the Management Studio connect to the database server. Always get this error:



Cannot connect ot MPLIAMSQLEXPRESS

Additional Information:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, erro: 26 - Error Locating Server/Instance Specified)(Microsoft SQL Server)



I have used the SQL Surface Area Configuration Tool to reset the defaults to allow remote connections, stopped and restarted the server, but still get the same message.

Please help.

View 12 Replies View Related

How To Transfer Data From A SqlServer Database To A SqlServer Express Database

Mar 29, 2006

Is there a way to transfer data from a SqlServer db to a SqlServer Express db. I tried to use the backup file of SqlServer, but this file is not valid for SqlServer Express. Or there any alternatives?

thanks,

Henk

View 7 Replies View Related

Coneverting Oledb Code To Connect To Remote Sqlserver

Sep 28, 2007

i have some oledb code made in c#(vs 2005) it is for local msaccess file. i want to conevert the code for sql server where connection string placed in web.config file seperately. please help me.here is code private void buildGrid()
{
string conStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=";
conStr += Server.MapPath("~/common/db/demo.mdb");
System.Data.OleDb.OleDbConnection dbCon = new System.Data.OleDb.OleDbConnection(conStr);
dbCon.Open();

string sql = "SELECT * FROM Posts ORDER BY LastPostDate DESC";
System.Data.OleDb.OleDbDataAdapter dbAdapter = new System.Data.OleDb.OleDbDataAdapter(sql, dbCon);
DataSet ds = new DataSet();
dbAdapter.Fill(ds);
ds.Tables[0].TableName = "Inbox";

Grid1.DataSource = ds;
}

 
 
please healp me..

View 3 Replies View Related

How To Connect With SqlServer 2000 In Pocket PC 2003 Application.

Oct 31, 2007

How to Connect sqlServer 2000 in Pocket PC 2003 Application.
In Packet PC 2003 Application I have to connect to sql server 2000 on
my machine. The application gives error if connected using sqlConnection. Is SQL server CE necessary to connect to sql server 2000 in .Net Compact Framework?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved