Friday, March 30, 2012
MS sql sever connection string
Can anybody write a code and tell me how can i access a table called
KF_STATUS which is stored in MS SQL server2000. and it thas 3 fields called
KF_ID ,KF_DATE, and KF_STATUS and how can i display contents of those fields
--
Message posted via http://www.sqlmonster.comHi,
Access the table:-
1. Login to QUERY analyzer by providing the user name password
2. From the database pane, select the database where the KF_STATUS table
resides
3. Write the below query
select KF_ID ,KF_DATE, KF_STATUS FROM KF_STATUS
4. Execute the query by pressing Control and E simulteneously. This will
give u result.
THnaks
Hari
SQL Server MVP
"gurvinder gill via SQLMonster.com" <forum@.nospam.SQLMonster.com> wrote in
message news:f68623ec640847c497a4e72817032580@.SQLMonster.com...
> Hi everybody
> Can anybody write a code and tell me how can i access a table called
> KF_STATUS which is stored in MS SQL server2000. and it thas 3 fields
> called
> KF_ID ,KF_DATE, and KF_STATUS and how can i display contents of those
> fields
> --
> Message posted via http://www.sqlmonster.com
MS sql sever connection string
Can anybody write a code and tell me how can i access a table called
KF_STATUS which is stored in MS SQL server2000. and it thas 3 fields called
KF_ID ,KF_DATE, and KF_STATUS and how can i display contents of those fields
Message posted via http://www.droptable.comHi,
Access the table:-
1. Login to QUERY analyzer by providing the user name password
2. From the database pane, select the database where the KF_STATUS table
resides
3. Write the below query
select KF_ID ,KF_DATE, KF_STATUS FROM KF_STATUS
4. Execute the query by pressing Control and E simulteneously. This will
give u result.
THnaks
Hari
SQL Server MVP
"gurvinder gill via droptable.com" <forum@.nospam.droptable.com> wrote in
message news:f68623ec640847c497a4e72817032580@.SQ
droptable.com...
> Hi everybody
> Can anybody write a code and tell me how can i access a table called
> KF_STATUS which is stored in MS SQL server2000. and it thas 3 fields
> called
> KF_ID ,KF_DATE, and KF_STATUS and how can i display contents of those
> fields
> --
> Message posted via http://www.droptable.comsql
Wednesday, March 28, 2012
MS sql sever connection string
Can anybody write a code and tell me how can i access a table called
KF_STATUS which is stored in MS SQL server2000. and it thas 3 fields called
KF_ID ,KF_DATE, and KF_STATUS and how can i display contents of those fields
Message posted via http://www.droptable.com
Hi,
Access the table:-
1. Login to QUERY analyzer by providing the user name password
2. From the database pane, select the database where the KF_STATUS table
resides
3. Write the below query
select KF_ID ,KF_DATE, KF_STATUS FROM KF_STATUS
4. Execute the query by pressing Control and E simulteneously. This will
give u result.
THnaks
Hari
SQL Server MVP
"gurvinder gill via droptable.com" <forum@.nospam.droptable.com> wrote in
message news:f68623ec640847c497a4e72817032580@.droptable.co m...
> Hi everybody
> Can anybody write a code and tell me how can i access a table called
> KF_STATUS which is stored in MS SQL server2000. and it thas 3 fields
> called
> KF_ID ,KF_DATE, and KF_STATUS and how can i display contents of those
> fields
> --
> Message posted via http://www.droptable.com
MS SQL sever 2000 string connection problem
The code given in the link below is for MS Access but I'm using MS SQL 2000, so i'm not sure of the syntax for the code provided below (string connectionString...)
Please help..thank u!!
http://www.asp.net/webmatrix/guidedtour/section91/bookrequestcontrol.aspx
string connectionString = @."Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\TempProjects\LibraryDatabase.mdb";
public void LoadRequestedBooks(){
try
{
string mySelectQuery = string.Format("SELECT books.* from books, requests where books.bid = requests.bid and requests.mid = {0}", Session["userid"]);
System.Data.OleDb.OleDbConnection myConnection = new System.Data.OleDb.OleDbConnection(connectionString);
System.Data.DataSet myDataSet = new System.Data.DataSet();
System.Data.OleDb.OleDbDataAdapter myOleDbDataAdapter = new System.Data.OleDb.OleDbDataAdapter(mySelectQuery, myConnection);
myOleDbDataAdapter.Fill(myDataSet);
DataGrid1.DataSource = myDataSet.Tables[0];
DataGrid1.DataBind();
myConnection.Close();
}
catch(Exception exp)
{
Label2.Text = "<br>Error: " + exp.Message + "<br>";
}
}Hi,
You may take a look at another section of the Web Matrix tutorial,
which is primarily focus on data access with SQL/MSDE Server:
http://asp.net/webmatrix/tour/section2/newconn.aspx
Colt|||hi again. thanks for the site, but my problem is the database is not storred locally. it's on the server. How should i change the syntax in the following code to suit MS Sql Server2000? Your help will be very much appreciated. Thank you.
string connectionString = @."Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\TempProjects\LibraryDatabase.mdb";
public void LoadRequestedBooks(){
try
{
string mySelectQuery = string.Format("SELECT books.* from books, requests where books.bid = requests.bid and requests.mid = {0}", Session["userid"]);
System.Data.OleDb.OleDbConnection myConnection = new System.Data.OleDb.OleDbConnection(connectionString);
System.Data.DataSet myDataSet = new System.Data.DataSet();
System.Data.OleDb.OleDbDataAdapter myOleDbDataAdapter = new System.Data.OleDb.OleDbDataAdapter(mySelectQuery, myConnection);
myOleDbDataAdapter.Fill(myDataSet);
DataGrid1.DataSource = myDataSet.Tables[0];
DataGrid1.DataBind();
myConnection.Close();
}
catch(Exception exp)
{
Label2.Text = "<br>Error: " + exp.Message + "<br>";
}
}|||Hi,
I see.. You can connect to a remote DB server by using its IP address,
E.g. "Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"
FYI:http://www.connectionstrings.com
Colt
MS Sql Server User ID, Password and connection string
I am making a software (.Net) which is going to connect a ms sql server but I cant conect yet :(.
1- I dont know what I have to type for user id (name)
2- What is my password, it has been long time that I hvae installed it but I dont need any password with Microsoft SQL Server Management Studio Express which has windows authentication option. My software can work via internet or network. So I need to know my user name and password. I am using oledbconnection. Do I need any password?
3- I visited www.connectionstrings.com already so I have the format of it.
Thanks very much for any help...you need to either use your windows account and use the example from connection strings dot com that uses windows auth or you need to go to SQL Server management studio to create a sql server login and password and you will need to give that account access to the specific database you are accessing.
man do the redskins suck.
MS Sql Server loosing connection over WAN ..
We are experiencing a weird MS Sql Server behavior, and so far I have
not been able to identify the problem.. Any pointers will be deeply
appreciated.
Here is the scenario: we have three servers. One of them is running MS
Sql Server 2000, and the other two are application servers connecting
to the SQL Server. One of them is connecting over LAN, the other over
WAN. Every now and then, the one connecting over WAN becomes unable to
communicate with the SQL server. Even the Query Analyzer is not able
to connect (it cannot even get the list of databases to fill the
combo).
At the same time, the server connecting to SQL over LAN can connect
and function without any problems.
When the SQL server machine is rebooted, the server on WAN is able to
connect again...
I was suspenting some intermittent network problems, but at the time
the problem occurs, the SQL server and the problematic server on WAN
can ping each other without any problem and telnet from the server on
WAN to the SQL server port 1433 seems to work fine.
Configuration: All three servers running on Windows Server 2003 SP1,
SQL Server version is 2000 SP3a.
Where should we look into ?
Many thanks in advance,
Arifi Koseoglu
http://vyaskn.tripod.com/watch_your_timeouts.htm
check it out.
You should run a trace with profiler to capture info what happens in the
database when the problems acure.
Cheers
"arifi" wrote:
> Hello everyone.
> We are experiencing a weird MS Sql Server behavior, and so far I have
> not been able to identify the problem.. Any pointers will be deeply
> appreciated.
> Here is the scenario: we have three servers. One of them is running MS
> Sql Server 2000, and the other two are application servers connecting
> to the SQL Server. One of them is connecting over LAN, the other over
> WAN. Every now and then, the one connecting over WAN becomes unable to
> communicate with the SQL server. Even the Query Analyzer is not able
> to connect (it cannot even get the list of databases to fill the
> combo).
> At the same time, the server connecting to SQL over LAN can connect
> and function without any problems.
> When the SQL server machine is rebooted, the server on WAN is able to
> connect again...
> I was suspenting some intermittent network problems, but at the time
> the problem occurs, the SQL server and the problematic server on WAN
> can ping each other without any problem and telnet from the server on
> WAN to the SQL server port 1433 seems to work fine.
> Configuration: All three servers running on Windows Server 2003 SP1,
> SQL Server version is 2000 SP3a.
> Where should we look into ?
> Many thanks in advance,
> Arifi Koseoglu
>
|||Sounds like this is a network issue, not a database issue. There could be a
resource limitation somewhere or something maybe happening on a router or
firewall somewhere that could be causing this.
MG
"arifi" wrote:
> Hello everyone.
> We are experiencing a weird MS Sql Server behavior, and so far I have
> not been able to identify the problem.. Any pointers will be deeply
> appreciated.
> Here is the scenario: we have three servers. One of them is running MS
> Sql Server 2000, and the other two are application servers connecting
> to the SQL Server. One of them is connecting over LAN, the other over
> WAN. Every now and then, the one connecting over WAN becomes unable to
> communicate with the SQL server. Even the Query Analyzer is not able
> to connect (it cannot even get the list of databases to fill the
> combo).
> At the same time, the server connecting to SQL over LAN can connect
> and function without any problems.
> When the SQL server machine is rebooted, the server on WAN is able to
> connect again...
> I was suspenting some intermittent network problems, but at the time
> the problem occurs, the SQL server and the problematic server on WAN
> can ping each other without any problem and telnet from the server on
> WAN to the SQL server port 1433 seems to work fine.
> Configuration: All three servers running on Windows Server 2003 SP1,
> SQL Server version is 2000 SP3a.
> Where should we look into ?
> Many thanks in advance,
> Arifi Koseoglu
>
sql
MS Sql Server loosing connection over WAN ..
We are experiencing a weird MS Sql Server behavior, and so far I have
not been able to identify the problem.. Any pointers will be deeply
appreciated.
Here is the scenario: we have three servers. One of them is running MS
Sql Server 2000, and the other two are application servers connecting
to the SQL Server. One of them is connecting over LAN, the other over
WAN. Every now and then, the one connecting over WAN becomes unable to
communicate with the SQL server. Even the Query Analyzer is not able
to connect (it cannot even get the list of databases to fill the
combo).
At the same time, the server connecting to SQL over LAN can connect
and function without any problems.
When the SQL server machine is rebooted, the server on WAN is able to
connect again...
I was suspenting some intermittent network problems, but at the time
the problem occurs, the SQL server and the problematic server on WAN
can ping each other without any problem and telnet from the server on
WAN to the SQL server port 1433 seems to work fine.
Configuration: All three servers running on Windows Server 2003 SP1,
SQL Server version is 2000 SP3a.
Where should we look into ?
Many thanks in advance,
Arifi Koseogluhttp://vyaskn.tripod.com/watch_your_timeouts.htm
check it out.
You should run a trace with profiler to capture info what happens in the
database when the problems acure.
Cheers
"arifi" wrote:
> Hello everyone.
> We are experiencing a weird MS Sql Server behavior, and so far I have
> not been able to identify the problem.. Any pointers will be deeply
> appreciated.
> Here is the scenario: we have three servers. One of them is running MS
> Sql Server 2000, and the other two are application servers connecting
> to the SQL Server. One of them is connecting over LAN, the other over
> WAN. Every now and then, the one connecting over WAN becomes unable to
> communicate with the SQL server. Even the Query Analyzer is not able
> to connect (it cannot even get the list of databases to fill the
> combo).
> At the same time, the server connecting to SQL over LAN can connect
> and function without any problems.
> When the SQL server machine is rebooted, the server on WAN is able to
> connect again...
> I was suspenting some intermittent network problems, but at the time
> the problem occurs, the SQL server and the problematic server on WAN
> can ping each other without any problem and telnet from the server on
> WAN to the SQL server port 1433 seems to work fine.
> Configuration: All three servers running on Windows Server 2003 SP1,
> SQL Server version is 2000 SP3a.
> Where should we look into ?
> Many thanks in advance,
> Arifi Koseoglu
>|||Sounds like this is a network issue, not a database issue. There could be a
resource limitation somewhere or something maybe happening on a router or
firewall somewhere that could be causing this.
--
MG
"arifi" wrote:
> Hello everyone.
> We are experiencing a weird MS Sql Server behavior, and so far I have
> not been able to identify the problem.. Any pointers will be deeply
> appreciated.
> Here is the scenario: we have three servers. One of them is running MS
> Sql Server 2000, and the other two are application servers connecting
> to the SQL Server. One of them is connecting over LAN, the other over
> WAN. Every now and then, the one connecting over WAN becomes unable to
> communicate with the SQL server. Even the Query Analyzer is not able
> to connect (it cannot even get the list of databases to fill the
> combo).
> At the same time, the server connecting to SQL over LAN can connect
> and function without any problems.
> When the SQL server machine is rebooted, the server on WAN is able to
> connect again...
> I was suspenting some intermittent network problems, but at the time
> the problem occurs, the SQL server and the problematic server on WAN
> can ping each other without any problem and telnet from the server on
> WAN to the SQL server port 1433 seems to work fine.
> Configuration: All three servers running on Windows Server 2003 SP1,
> SQL Server version is 2000 SP3a.
> Where should we look into ?
> Many thanks in advance,
> Arifi Koseoglu
>
MS Sql Server loosing connection over WAN ..
We are experiencing a weird MS Sql Server behavior, and so far I have
not been able to identify the problem.. Any pointers will be deeply
appreciated.
Here is the scenario: we have three servers. One of them is running MS
Sql Server 2000, and the other two are application servers connecting
to the SQL Server. One of them is connecting over LAN, the other over
WAN. Every now and then, the one connecting over WAN becomes unable to
communicate with the SQL server. Even the Query Analyzer is not able
to connect (it cannot even get the list of databases to fill the
combo).
At the same time, the server connecting to SQL over LAN can connect
and function without any problems.
When the SQL server machine is rebooted, the server on WAN is able to
connect again...
I was suspenting some intermittent network problems, but at the time
the problem occurs, the SQL server and the problematic server on WAN
can ping each other without any problem and telnet from the server on
WAN to the SQL server port 1433 seems to work fine.
Configuration: All three servers running on Windows Server 2003 SP1,
SQL Server version is 2000 SP3a.
Where should we look into ?
Many thanks in advance,
Arifi Koseogluhttp://vyaskn.tripod.com/watch_your_timeouts.htm
check it out.
You should run a trace with profiler to capture info what happens in the
database when the problems acure.
Cheers
"arifi" wrote:
> Hello everyone.
> We are experiencing a weird MS Sql Server behavior, and so far I have
> not been able to identify the problem.. Any pointers will be deeply
> appreciated.
> Here is the scenario: we have three servers. One of them is running MS
> Sql Server 2000, and the other two are application servers connecting
> to the SQL Server. One of them is connecting over LAN, the other over
> WAN. Every now and then, the one connecting over WAN becomes unable to
> communicate with the SQL server. Even the Query Analyzer is not able
> to connect (it cannot even get the list of databases to fill the
> combo).
> At the same time, the server connecting to SQL over LAN can connect
> and function without any problems.
> When the SQL server machine is rebooted, the server on WAN is able to
> connect again...
> I was suspenting some intermittent network problems, but at the time
> the problem occurs, the SQL server and the problematic server on WAN
> can ping each other without any problem and telnet from the server on
> WAN to the SQL server port 1433 seems to work fine.
> Configuration: All three servers running on Windows Server 2003 SP1,
> SQL Server version is 2000 SP3a.
> Where should we look into ?
> Many thanks in advance,
> Arifi Koseoglu
>|||Sounds like this is a network issue, not a database issue. There could be a
resource limitation somewhere or something maybe happening on a router or
firewall somewhere that could be causing this.
--
MG
"arifi" wrote:
> Hello everyone.
> We are experiencing a weird MS Sql Server behavior, and so far I have
> not been able to identify the problem.. Any pointers will be deeply
> appreciated.
> Here is the scenario: we have three servers. One of them is running MS
> Sql Server 2000, and the other two are application servers connecting
> to the SQL Server. One of them is connecting over LAN, the other over
> WAN. Every now and then, the one connecting over WAN becomes unable to
> communicate with the SQL server. Even the Query Analyzer is not able
> to connect (it cannot even get the list of databases to fill the
> combo).
> At the same time, the server connecting to SQL over LAN can connect
> and function without any problems.
> When the SQL server machine is rebooted, the server on WAN is able to
> connect again...
> I was suspenting some intermittent network problems, but at the time
> the problem occurs, the SQL server and the problematic server on WAN
> can ping each other without any problem and telnet from the server on
> WAN to the SQL server port 1433 seems to work fine.
> Configuration: All three servers running on Windows Server 2003 SP1,
> SQL Server version is 2000 SP3a.
> Where should we look into ?
> Many thanks in advance,
> Arifi Koseoglu
>
Monday, March 26, 2012
MS SQL Server Express connection error from VB.net Program
m
my Visual Basic.Net program. I am using connection string as "Dim
connectionString As String = "Data Source=.\SQLEXPRESS;Initial
Catalog=MgmtSystem;User Instance=True".
But it is giving me error as " Failed to generate a user instance of SQL
Server. Only integrated connection can generate a User Instance".
I can connect to this "MgmtSystem" database successfully using Microsoft SQL
Server Management Studio Express though.
What could be the possible reason for this error? How do I get the correct
connection string? and what does integrated connection mean? Your help will
be appreciated.
My application is in Access at the moment, but I am planning to migrate it
to Microsoft SQL Server Express 2005. I am completely new to Microsoft SQL
Server Express 2005 Express version.Fixed it by myself. I changed the connectiuon string to "Data
Source=.\SQLEXPRESS;AttachDbFilename=C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\MgmtSystem.mdf;Initial Catalog=MgmtSystem;Persist
Security Info=True;" ..and it worked..
"Sujata P" wrote:
> I am trying to make new connection with SQL Server 2005 Express Database f
rom
> my Visual Basic.Net program. I am using connection string as "Dim
> connectionString As String = "Data Source=.\SQLEXPRESS;Initial
> Catalog=MgmtSystem;User Instance=True".
> But it is giving me error as " Failed to generate a user instance of SQL
> Server. Only integrated connection can generate a User Instance".
> I can connect to this "MgmtSystem" database successfully using Microsoft S
QL
> Server Management Studio Express though.
> What could be the possible reason for this error? How do I get the correct
> connection string? and what does integrated connection mean? Your help wil
l
> be appreciated.
> My application is in Access at the moment, but I am planning to migrate i
t
> to Microsoft SQL Server Express 2005. I am completely new to Microsoft SQL
> Server Express 2005 Express version.|||Fixed it by myself. I changed the connectiuon string to "Data
Source=.\SQLEXPRESS;AttachDbFilename=C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\MgmtSystem.mdf;Initial Catalog=MgmtSystem;Persist
Security Info=True;" ..and it worked..
"Sujata P" wrote:
> I am trying to make new connection with SQL Server 2005 Express Database f
rom
> my Visual Basic.Net program. I am using connection string as "Dim
> connectionString As String = "Data Source=.\SQLEXPRESS;Initial
> Catalog=MgmtSystem;User Instance=True".
> But it is giving me error as " Failed to generate a user instance of SQL
> Server. Only integrated connection can generate a User Instance".
> I can connect to this "MgmtSystem" database successfully using Microsoft S
QL
> Server Management Studio Express though.
> What could be the possible reason for this error? How do I get the correct
> connection string? and what does integrated connection mean? Your help wil
l
> be appreciated.
> My application is in Access at the moment, but I am planning to migrate i
t
> to Microsoft SQL Server Express 2005. I am completely new to Microsoft SQL
> Server Express 2005 Express version.
MS SQL Server Error 233
When I try to login to SQL Server 2005 from Microsoft SQL Server Management
Studio, I got following:
A connection was successfully established with the server, but then an error
occurred during the login process. (provider: Shared Memory Provider, error:
0 - No process is on the other end of the pipe.) (Microsoft SQL Server,
Error: 233)
I use the "SQL Server authentication" mode and user name and password seems
correct.
I went to the "Surface Area Configuration for Services and Connections" and
check the "Remote Connections" under "Database Engine", it is "Using TCP/IP
only".
Also I checked "SQL Server Configuration Manager", under "SQL Server 2005
Network Configuration" -> "Protocols for MSSQLSERVER", "Shared Memory",
"Named Pipes" and "TCP/IP" are all "Enabled"
Please advise!
Thanks!
enable tcp/ip and you are good to go.
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
sql
MS SQL Server Database Connection Problems
I can connect successfully to the Microsoft SQL Server "Beauty" (get also nonzero for successfull connection). If i run the application (see code below). I get following Error Message "Illegal Objectname 'TestTabelle' ". I double checked the SQL statement and it should be correct. Even the spelling of TestTabelle is right. For testing purposes I've also included 5-6 data records in the tabel.
I try to connect via ODBC. I've created the database with MS SQL Enterprise Manager. Right Click -> Create New Database. I called it "Test" and created in "Test" a new Table, which is called "TestTabelle".
I found information how i can connect to a ms sql server "Beauty", i've also found how i can connect to a table, BUT where is the information which Database ?`in my case it should be Test.
how can i setup a default database... Cause in my application i can't access my Test Database.... See code below :(
Why is this code BOLD not working if i try to select a database ?
Thank You
Indian
{
CDBVariant value;
char sql_statement [2048] = "";
//CDatabase object "db" created to connect database
CDatabase db;
db.OpenEx(_T("DSN=Beauty;UID=Administrator"), CDatabase::noOdbcDialog);
//CRecordset object "rs" created to access and manipulate database records.
CRecordset rs(&db);
strcpy(sql_statement,_T("SELECT * FROM TestTabelle")); <- NOT WORKING... GETTING ERROR MESSAGE if i use this sql_statement " USE TEST; SELECT * FROM TestTabelle"
rs.Open(CRecordset::forwardOnly,sql_statement);
//Get quantity from Database
int n = rs.GetODBCFieldCount( );
while(!rs.IsEOF())
{
for( int i = 0; i < n; i++ )
{
rs.GetFieldValue("index",value);
m_Buy_List.InsertItem(i,LPCTSTR(value.m_pstring));
rs.GetFieldValue("product",value);
m_Buy_List.SetItemText(i,2,LPCTSTR(value.m_pstring ));
rs.GetFieldValue("price",value);
m_Buy_List.SetItemText(i,3,LPCTSTR(value.m_pstring ));
}
rs.MoveNext( );
}
//Close records access.
rs.Close( );
//Close database connection.
db.Close();
}double-click on Administrator (login) and select the default database from the drop-down box at the bottom of this dialog box.|||Better yet, use a more explicit query. Try:
strcpy(sql_statement,_T("SELECT * FROM Test.TestTabelle"));|||Better yet, use a more explicit query. Try:
strcpy(sql_statement,_T("SELECT * FROM Test.TestTabelle"));|||Sorry. Just replace the line in your code.
You could also skip ODBC, and specify the database in your connection string by using OLEDB.
Try this line in your code to connect to the server...
//CDatabase object "db" created to connect database
CDatabase db;
db.OpenEx(_T("Provider=SQLOLEDB.1;Data Source=Beauty;Initial Catalog=Test;UID=Administrator"), CDatabase::noOdbcDialog);|||i figured it out
thx
Friday, March 23, 2012
ms sql server 2005 on my vista machine
Trying to set up a syn connection with my ipaq travel companion but
it syncs to sql server instead of to outlook.
If I uninstall sql server 2005, will it be missed by any other processes, etc.
on Vista and have it again do something ugly.
Thanks,
Bob
Vista does not require sql2k5 to run. However, if it's pre-installed, there must be a need for it by one of your third party app. If you installed it yourself and it's for fun/dev, you can safely remove/uninstall it.
Wednesday, March 21, 2012
MS SQL Server 2000, and ASP.NET 2.0 membership controls (login)
when my ASP.NET 2.0 web site working against MS SQL Server 2000,
I Usually have a connection string to the DB, I create a connection, and start working on the data.
While reading about the MemberShip provider of ASP.NET 2.0 (Login control, Forgot password, etc.),
I read that it's possible to save the MDF file of the membership controls, within the APP_DATA folder.
But how can it be ? the MDF file must be at the server folder,
How can I access this MDF file ? with which connection string ?
How does MS SQL Server 2000 syncronize against this MDF file within my APP_DATA folder ?
And by the way, if my hosting company allow me to use 1 db schema of the MS SQL Server 2000 server,
Does this method (saving the MDF file within thr APP_DATA folder) allow me to use multiple schemas ?
Thanks.
Hi,
But how can it be ? the MDF file must be at the server folder
For your first question, the built-in database is a new feature in .NET 2.0 which needs SQLExpress to support. The database is together with your application, you don't need to deploy the database additionally. The MDF file is stored in a folder called APP_DATA. When you application runs, the files in APP_DATA will be shipped as a database with your application automatically.
How can I access this MDF file ? with which connection string ?
If you want to access the database in SQLExpress, you also need connection string to achieve that. By default, the connection string for SQLExpress (built-in database) is located in Machine.Config, the name of the connection string is "LocalSqlServer", and you also can overwrite it and declare it at web.config file, even change the name of the connection string. But what you should note is, don't forget to modify the connection string attribute of the provider so that all the features supported by provider mechanism (i.e. Membership,Profile and etc) can work.
How does MS SQL Server 2000 syncronize against this MDF file within my APP_DATA folder
When you have decided to use SQLExpress to support your provider mechanism application, you don't need to use SQLServer2000. But if you want those provider supported application to work with SQLServer2000. You should use aspnet_regsql tool to transport the ASPNETDB to SQLServer2000 database, and modify the connection string attribute of corresponding provider.
For aspnet_regsql.exe tool, see:http://msdn2.microsoft.com/en-us/library/ms229862(VS.80).aspx
For more information about ASP.NET provider, see:
http://msdn2.microsoft.com/en-us/library/aa478948.aspx
Thanks.
Thanks,
At my development machine :
But I removed SQL Server express from my machine, that means I can't just add the login control, than the MDF file will be created at the APP_DATA,
And everything will be ok ? I must install MS SQL Server express ?
At the hosting server :
There is ms sql server 2000, just copying the MDF data to the AAP_DATA, I guess will not work, right ?
I will need to mograte this MDF file, from my APP_DATA folder, to the real DB, right?
Hi,
But I removed SQL Server express from my machine, that means I can't just add the login control, than the MDF file will be created at the APP_DATA,
And everything will be ok ? I must install MS SQL Server express ?
When you remove your SQLExpress edtion, you still can use such features like membership. (Login controls,CreateUserWizard controls and etc.) But you should export the ASPNETDB in SQLExpress to SQLServer Database before you removing your SQLExpress, and change the membership provider.
There is ms sql server 2000, just copying the MDF data to the AAP_DATA, I guess will not work, right ?
It will not work. To use the database in APP_DATA, you must have SQLExpress installed on your server.
I will need to mograte this MDF file, from my APP_DATA folder, to the real DB, right
Right, you need to export the ASPNETDB.mdf to your SQLServer 2000 database.
Thanks.
|||Thanks
MS SQL Server 2000 / MS Access - ODBC connection question
I have such question to all of you.
I have some tables linked from MS SQL Server 2000. Is time of processing
query
based on these linked tables from MS SQL Server 2000, faster or slower than
the time of processing the same query based on tables, which are not linked
but
imported to MS Access?
Can you answer this question?
Thank you in advance for posts
Marcin from Poland.No idea - it depends how big the tables are, what your queries look
like, how you execute your queries etc. If you're using stored
procedures, for example, then I would expect MSSQL to be faster, as all
the processing happens on the server, and it can use indexes, caching
etc. The best way to get an answer is simply to test it yourself.
Simon
Monday, March 12, 2012
MS SQL jdbc driver problem in Connection pool in TOMCAT 5
Driver. I use Apache 2.0.49, Tomcat 5.0.19, windows 2000 server, MS
SQL server 2000 + sp4
My configuration is as following. The error occurs at
envCtx.lookup("jdbc/dbname");
1) I copy the three jar files to \common\lib in %catalina_home% from
C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC
2) MY webapps/ROOT/web-inf/web.xml is:
...
<resource-ref>
<description> JDBC Driver:
com.microsoft.jdbc.sqlserver.SQLServerDriver</description>
<res-ref-name>jdbc/dbname</res-ref-name>
<res-type>com.microsoft.jdbcx.sqlserver.SQLServerDataSo urce</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
3) my JSP file is in /ROOT/zuo, it contains code:
<%@. page import="java.sql.*" %>
<%@. page import="java.lang.reflect.*" %>
<%@. page import="java.io.*" %>
<%@. page import="javax.naming.*" %>
.....
<%....
envCtx = (Context) initCtx.lookup("java:comp/env");
ds = (ConnectionPoolDataSource ) envCtx.lookup("jdbc/dbname");
if (ds != null){
if(ds instanceof com.microsoft.jdbcx.sqlserver.SQLServerDataSource) {
SQLServerDataSource temp =
(com.microsoft.jdbcx.sqlserver.SQLServerDataSource )ds;
con = temp.getPooledConnection("dzuo","dzuo").getConnect ion();
...%>
4) I add text in apache2/conf/server.xml :
<GlobalNamingResources>
.....
<Resource name="jdbc/dbname" auth="container"
type="com.microsoft.jdbcx.sqlserver.SQLServerDataS ource" />
<ResourceParams name="jdbc/dbname">
<parameter>
<name>factory</name>
<value>com.microsoft.jdbcx.sqlserver.SQLServerData SourceFactory</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.microsoft.jdbcx.sqlserver.SQLServerData Source</value>
</parameter>
<parameter>
<name>driverName</name>
<value>SQLServer</value>
</parameter>
<parameter>
<name>description</name>
<value>SQL Server DataSource</value></parameter>
<parameter>
<name>serverName</name><value>"serverNmae"</value>
</parameter>
<parameter>
<name>portNumber</name><value>1433</value>
</parameter>
<parameter><name>user</name><value>"dzuo"</value></parameter>
<parameter><name>password</name><value>"dzuo"</value></parameter>
</ResourceParams>
(... other resources ...)
</GlobalNamingResources>
.....
</Host>
</Engine>
</Service>
</Server>
Please forward instruction, or any suggestion. Thanks a lot.
Did you had any luck. I am trying to do the same thing under tomcat. So far no luck with connection pooling.
|||use com.microsoft.jdbc.sqlserver.SQLServerDriver instead of com.microsoft.jdbcx.sqlserver.SQLServerDataSource as the jdbc driver.
I use the admin UI to config
step 1: create context;
step 2: create datasource, like following:
JNDI Name: jdbc/mnr
Data Source URL: jdbc:microsoft:sqlserver://mnrserver:1433;
JDBC Driver Class: com.microsoft.jdbc.sqlserver.SQLServerDriver
User Name: mnr
Password: xxxx
Max. Active Connections: 4
Max. Idle Connections: 2
Max. Wait for Connection: 5000
Validation Query: select * from MNR_Estm
step 3: jsp
<%@.page import="java.sql.*"%>
<%@.page import="javax.sql.*"%>
<%@.page import="javax.naming.*"%>
<%
DataSource ds = null;
InitialContext initContext = new javax.naming.InitialContext();
out.print("Getting datasource(jdbc/css)... ");
ds = (javax.sql.DataSource)initContext.lookup("java:com p/env/jdbc/mnr");
out.println("successfully");
Connection conn = ds.getConnection();
Statement stmt = conn.createStatement();
ResultSet rst = stmt.executeQuery(" select * from MNR_Estm");
while(rst.next()){
out.println(rst.getString("Estno"));
}
conn.close();
%>
step 4: access http://127.0.0.1:9000/quartz/scripts/edi/b.jsp
It's ok.
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
MS SQL Express - Connection Strings for Depolyment
<connectionStrings>
<add name="CustomerConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="D:\-- Work Documents --\Workez\Web\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings
It's obvious to me that the next in orange would cause my db application not to work when i roll it out onto the net.
Am i correct to say this? I recalled i needed something like "Server.mappath("path-name")"
anyone know what i need to do?
Xarain wrote:
From my Web.Config
<connectionStrings>
<add name="CustomerConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="D:\-- Work Documents --\Workez\Web\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings
It's obvious to me that the next in orange would cause my db application not to work when i roll it out onto the net.Am i correct to say this? I recalled i needed something like "Server.mappath("path-name")"
anyone know what i need to do?
Hi,
Actually when you publish the website, you have to setup the database in the SQL server provided by the hosting service and you cannot use the db in the app_data folder at all.
Friday, March 9, 2012
MS SQL connection could not be established
John Almeda
System Adm
It seems that I have done something really stupid or something went
boonkers. I was restoring a DB whn I got a message that the log file
could not be restored because it was XXXXXX??. This left my DB greyed
out and with a (loading) sign. I tried to detach and then re-attech the
DB and all hell broke loose. Now I cannot connect to any of my DB's. The
message I get is "a connection could not be established on sqlsrvr .
Cannot open users default db. Login failed."
I cannot see any of db under that regitration and the connection
continues to fail. I am drawing a total blank as to why and how to
correct with the exception of unistalling MSSQL and re-installing the
server and then trying to establish a connection with my db's again.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!You can connect and change your default database to master using osql:
osql -S MyServer -E -d master -Q"exec sp_defaultdb 'MyLogin', 'master'"
That should allow you to connect to the server as usual, and then you
can try restoring your database again - if you still have problems at
that point, it would be useful to see the exact error message.
Simon
MS SQL conn string
server=(local)\\DB;Integrated Security=True;uid=;pwd=;database=AspNetDb
When I moved my SQL server to another machine within my LAN, it stopped functioning.
server=(192.168.1.3)\\DB;IntegratedSecurity=True;uid=;pwd=;database=AspNetDb
Could someone kindly give me some advice? I appreciate your assistance.look at:
http://www.connectionstrings.com/
MS SQL and ASP.NET connection problem
Im trying to set up a ASP.NET webform to a MS SQL database. Im currently databinding to a datagrid. My code seems to compile correctly, no errors, however the data does not display.
I have tried to connect to the database server using the data adapter preview and works perfectly. But once i get the webpage running nothing displays from my VB code.
Does anyone have any clue to a resolution? THANK YOU ALL!I don't know if this is the problem, but I think after setting the datagrid's datasource property to the dataset, you have to type this:
"datagrid1.bind" or maybe "datagrid1.databind" (one of them: I can't quite remember)
Hope this helps.
Wes
Saturday, February 25, 2012
MS SQL 2005 Connection Problems
I have an MS SQL problem,
I have set up Adobe Enterprisewith a MS SQL 2005 database. Although ‘Connect’ recognised the SQL data source on install it now refuses to connect. The SQL log shows that a connection is being attempted every time the System Administrator username and password details are entered into the ‘Connect’ configuration, so details such as host, data source, ports etc are all right.
I assume this must be an authentication problem as I can connect to the data source fine in the MS SQL 2005 management tool, I thought it may be because I have Windows Authentication on rather than mixed mode authentication…but I don’t seem either a) change to mixed mode or b) change the password.
How do I either reset the MS SQL system admin details or access the database outside of the SQL management software to verify that the login details I am putting into Connect are in fact right...this is of course assuming it is an authentication problem.
Any help please….
Wow not one reply, oh well!
In the end it was simply an authentication problem as I thought.
By switching to Mixed Mode authentication (SQL authentication) rather than Windows Authentication (which is automatic and the default) it is possible to login from the Connect Config screen. You must also make sure "user desktop notification" is switched on for Adobe Breeze in the windows admin setting.
If this is done there may well be a problem if the system fails i.e. errors will only appear on the server, I am also unsure of any extra security issues that may prove a problem by switching to mixed mode.
So, it works but if anyone has any better ideas or advice please let me know.
Thanks