Showing posts with label hii. Show all posts
Showing posts with label hii. Show all posts

Wednesday, March 28, 2012

MS Sql Server User ID, Password and connection string

Hi;
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.

Monday, March 26, 2012

MS SQL Server Database Connection Problems

Hi

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

Wednesday, March 21, 2012

MS SQL Server 2005

Hi

I Just installed MS SQL Server 2005 but have no idea how to build a database with det.
I just can start SQL computer mannager but can't create database

Someone who can help with this please?Hi

Have answer for the problem, thanks anyway.|||Use SQLWrok bench! Using that you can do it!

MS SQL Server 2000... Error backing up database

Hi

I am getting an error while backing up a particular database named "asset" . The error says ......

Server: Msg 3132, Level 16, State 1, Line 4
The media set for database 'Asset' has 2 family members but only 1 are provided. All members must be provided.
Server: Msg 3013, Level 16, State 1, Line 4
BACKUP DATABASE is terminating abnormally.

I have created two backup devices for this database ("asset") through enterprise manager.
AssetDMP
AssetLogDMP

I have total 9 databases out of which only this database throws error. All other database backups going fine.

Here is the query that I am using to backup the database and Log.

USE master
GO
IF EXISTS (SELECT * FROM sysdatabases WHERE name = 'Asset')
BACKUP DATABASE Asset TO AssetDMP WITH NOUNLOAD, STATS=10, INIT, SKIP
GO
IF EXISTS (SELECT * FROM sysdatabases WHERE name = 'Asset')
BACKUP LOG Asset TO AssetLogDMP WITH NOUNLOAD, STATS=10, INIT, SKIP

Please Help

Thank You / SsgThis error occurs if a member of the stripe set (the backup was performed to more than 1 backup file/device) that was originally used to create the backup, was not selected when you tried to perform the restore. The number that displays in the message shows the set or file number that is missing.

You need to provide all the backup devices, files in your restore command|||Originally posted by Satya
This error occurs if a member of the stripe set (the backup was performed to more than 1 backup file/device) that was originally used to create the backup, was not selected when you tried to perform the restore. The number that displays in the message shows the set or file number that is missing.

You need to provide all the backup devices, files in your restore command

Dear Satya,

Thanks a lot for your quick response. This issue has been resolved by re creating the devices ; but somehow I could not understand the root cause of the problem ;). Anyway, I wanted to ask one more question here...

I am using MS SQL 2000 Server. Can I move the dabases ( Master, Model , MSDB and tempdb) to a different drive location without re-installing SQL Server !!!

Waiting for an early reply...

Thanks again,
Ssg|||Here you go with this KBA (http://support.microsoft.com/default.aspx?scid=kb;EN-US;224071) .|||BTW where abouts you're in Bangalore??|||Originally posted by Satya
BTW where abouts you're in Bangalore??

Thanks Satya,

My Question has been answered. Great help !!!

I am in ShanthiNagar , Bangalore -27

R U Familiar with BLR ?? I mean r u a bangalorean ?

Tks / Ssg|||Glad this works... I sent you private message as its ideal for personal chat.|||Originally posted by Satya
Glad this works... I sent you private message as its ideal for personal chat.

satya,

I don't find any private mesg.. It shows empty..however you can mail me.

Thanks
Ssg|||My PM tracking confirms an email sent to you about this Private message, check the email when you registered to this site.

MS SQL Server 2000 replication deployment

Hi
I want to implement transactional replication on 2 MS SQL Servers 2000
(SP3). Is there any good guide available that discusses crucial points in
this endeavour (e.g. possible topologies, what and how needs to be monitored,
potential issues to avoid, what to do in case of failures etc.)? I need a
document that focuses on moving the replication into production environment.
I'm especially interested in alternative means of monitoring the replication
rather than the built-in one.
Many thanks,
Oskar
You can check BOL, do a search on MSDN for transactional replication. You
might want to consider my book
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Oskar" <Oskar@.discussions.microsoft.com> wrote in message
news:3F9E5C48-79C8-4D76-87C8-B9C2ABC6C840@.microsoft.com...
> Hi
> I want to implement transactional replication on 2 MS SQL Servers 2000
> (SP3). Is there any good guide available that discusses crucial points in
> this endeavour (e.g. possible topologies, what and how needs to be
monitored,
> potential issues to avoid, what to do in case of failures etc.)? I need a
> document that focuses on moving the replication into production
environment.
> I'm especially interested in alternative means of monitoring the
replication
> rather than the built-in one.
> --
> Many thanks,
> Oskar
>
|||Yeah, but are you completely sure that these sources give answers to the
specific questions I have? So far I was unable to find answers to my
questions in BOL.
"Hilary Cotter" wrote:

> You can check BOL, do a search on MSDN for transactional replication. You
> might want to consider my book
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "Oskar" <Oskar@.discussions.microsoft.com> wrote in message
> news:3F9E5C48-79C8-4D76-87C8-B9C2ABC6C840@.microsoft.com...
> monitored,
> environment.
> replication
>
>

Friday, March 9, 2012

MS SQL database not connecting problem

hi

I usually did my database in SQL Server Management Studio Express then when I was in Visual Studios I would connect to it in the server explorer tab but I wanted to try to do it through Visual studios so I took my database files then went to my app_data folder and added them as existing items. I then went back to the server explorer tab and set it up.

Everything thing seemed to set up but when I run it I get an error.

I get this error when it does conn.Open();

Error:

1System.Data.SqlClient.SqlException was unhandledbyuser code2 Message="Cannotopen database \"Japanese\" requestedby the login. The login failed.\r\nLogin failedforuser'HOWSER\\chobo'."3 Source=".Net SqlClient Data Provider"4 ErrorCode=-21462320605 Class=116 LineNumber=655367 Number=40608Procedure=""9 Server="localhost\\SqlExpress"10 State=111 StackTrace:12 at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)13 at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)14 at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)15 at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)16 at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)17 at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)18 at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)19 at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentityidentity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)20 at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)21 at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)22 at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)23 at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)24 at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)25 at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)26 at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)27 at System.Data.SqlClient.SqlConnection.Open()28 at Practice.Page_Load(Object sender, EventArgs e)in h:\Website\Japanese\Practice.aspx.cs:line 2829 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)30 at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)31 at System.Web.UI.Control.OnLoad(EventArgs e)32 at System.Web.UI.Control.LoadRecursive()33 at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)34
This is what I have as my connection stuff
webconfig
1 <connectionStrings>2 <add name="Japanese" connectionString="Server=localhost\SqlExpress;3 Database=Japanese; Integrated Security=True"4 providerName ="System.Data.SqlClient"/>5 </connectionStrings>67
In my file
 
1 SqlConnection conn;2 SqlCommand comm;3 SqlDataReader reader;45string connectionString = ConfigurationManager.ConnectionStrings["Japanese"].ConnectionString;6 conn =new SqlConnection(connectionString);78 comm =new SqlCommand("SELECT HiraganaCharacter,HiraganaImage FROM Hiragana", conn);9 conn.Open();10 reader = comm.ExecuteReader();
Thanks

 

Hi,

can you check your code connection string?

it would be usually in this format for SQLserver connection in the config file:

connectionString="Data Source=yourservername;Initial Catalog=yourdatabasename;User ID=userid"

providerName="System.Data.SqlClient"

Hope this helps

MS Sql Database

Hi
I have access to a MS Sql database from my webhost.
I have used MS Acces in the past and created the tables locally then uploaded the MS Access DB.
How & what do I use to connect to the MS SQL DB on my web host and how do I create tables within the DB?
I'm very new to using and trying to connect to MS Sql DB.
Thanks for any help in advance.
Cheers
kefi2927

Hi,

You would either require a SQL Client installation to connect to the Server where SQL Server exists to create Database/Tables etc.,

Else, you would require Remote Desktop Access to logon to the Server and work directly over there.

Thanks.

|||Hi
Thanks for the reply.
What utility would I use for a Remote Desktop Access.
Cheers|||Hi,
Remote Desktop Access is built-in functionality from Windows XP Professional (not sure about the Home Edition).
From START- RUN - Type "mstsc" and give ENTER. You will get the dialog for entering the IP address of the machine.
If Remote Desktop Access is enabled to the server and you are connected to the Internet, you can logon to that machine from your machine.
If you are running older versions or require Remote Desktop Client software, you can check and download fromhttp://www.microsoft.com/windowsxp/downloads/tools/rdclientdl.mspx
Thanks.