Showing posts with label strange. Show all posts
Showing posts with label strange. Show all posts

Saturday, February 25, 2012

Application not connecting to DB on restart of PC?

Hi,

i am stuck in a strange situation.
I

have successfully built my application setup through InstallSheild 12.

Which first installs SQL Express user define instance as a

pre-requisite and then install my application files. First time when i

run my application (without restarting the pc), it connects

successfully with user define instance.
But as i restart my PC and try to open my application, it is not connecting with database.
i am using the following command line to install SQL Express 2005 user define instance:

"/qn ADDLOCAL=SQL_Engine INSTANCENAME=MyInstance SECURITYMODE=SQL SAPWD="test" AUTOSTART=1"

if

i change Remote connection to "using both TCP/IP and named pipes"

through "SQL Server Surface Area Configuration" and then restart my pc

again. My application connects successfully with Database.

Please

guide me where i am getting wrong in building setup. do i have to add

something in my command line to not get this error

Please provide more information...

What error are you getting?

How are you connecting to SQL Express? (i.e. connection string)

What is different from the first time you connect at installation and the second time you connect after re-boot?

Are you using ODBC, OLEDB or Shared Memory to connect?

Mike

|||Hi,
thanks for the reply.
i am installing my installer on WinXP machine.
i am using the following connection string to connect with database.

Connection String:
--
Connection.ConnectionString = "packet size=4096;user id=sa;pwd=test; data source = (local)\\MyInstance;initial catalog = MyDB";

Error getting when connecting to SQL Mangmnt Studio:
-
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: Shared Memory Provider, error: 40 -
Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

when first time i install , In "SQL Server Surface Area Configuration" it is checked on "Local Connection Only" and connects successfully.
When i restart my pc and open application it doesnt connect .I open "SQL Server Surface Area Configuration", still "Local Connection Only" is checked but when i check on "using both TCP/IP and named pipes".
and then start my applicaion it connects successfully.|||Hi,
i am using following namespace for connection object.
using System.Data.SqlClient;

Friday, February 24, 2012

Application cannot connect to SQL Server 2005.

I am having a strange problem. I have an application that to connects to SQL Database in SQL Server 2005.

When I run the application with Visual Studio everything works fine but when I deploy the application on my web server and then to access the site .

I get an error :Login failed for user ''. The user is not associated with a trusted SQL Server connection.

For some reason the application is not passing the user name . I have checked the IIS and authentication is set to Integrated Windows Authentication .

My connection string is correct as well

<add name="xxxxx" connectionString="Data Source=xxxxxx;Initial Catalog=xxxx;Integrated Security=SSPI" providerName="System.Data.SqlClient"/>

I will appreciate any kind of assistance in this matter. Thanks

check under which login your asp web page works ASPNET or Network service and create login on your SQL server for this account.

You also have to give access to your databases for this login.

If you run web page on IIS server user under which IIS server is running (or your web page specific user) requests access to SQL server.

|||

I check my sql logs and when I tried to make a connection using : UID and PWD in my connection string. The log says that

Login failed for user "<username"> [CLIENT:xxx.xxx.xxx.xxx]

below that I saw the the same user successfully logged using Management Studio saying

Login succeeded for user "<username>" [CLIENT:local machine]

I don't understand the difference. It is the same user connecting from the same local machine where sql is loaded.

Thanks

Thursday, February 16, 2012

Append query from Access Table to Linked SQL Server Table Failing

Strange one here - I am posting this in both SQL Server and Access forums

Access is telling me it can't append any of the records due to a key violation.

The query:

INSERT INTO dbo_Colors ( NameColorID, Application, Red, Green, Blue )
SELECT Colors_Access.NameColorID, Colors_Access.Application, Colors_Access.Red, Colors_Access.Green, Colors_Access.Blue
FROM Colors_Access;

Colors_Access is linked from another MDB and dbo_Colors is linked from SQL Server 2000.

There are no indexes or foreign contraints on the SQL table. I have no relationships on the dbo_ table in my MDB. The query works if I append to another Access table. The datatypes all match between the two tables though the dbo_ tables has two additional fields not refrenced in the query.

I can manually append the records using cut and paste with no problems.

I have tried re-linking the tables.

Any ideas?
Thanks,
BradI'd guess that the SQL Server db you think you are linking to in dbo_Colors isn't really the one you think. Perhaps the login/password in your datasource is connecting to a different database than the one you expect?

To check, get the name of the constraint being violated and check in the sql server table to see if that constraint exists

Also, try running the sql server profiler to see what sql server db ms access is trying to insert data into|||mattrevs,

It does appear that I am linking the right table. There is only one Colors table and only one database that has a colors table.

Could you tell me how to check which constraint is being violated? After I manually pasted the data into dbo_Colors, I ran checkconstraints() and no error were reported.

I also tried running the query with implicit_transaction OFF and still no joy.

I ran the trace and here are the last two lines. The first one was simply duplicated for each record:

RPC:Completed exec sp_executesql N'INSERT INTO "dbo"."Colors" ("NameColorID","Application","Red","Green","Blue") VALUES (@.P1,@.P2,@.P3,@.P4,@.P5)', N'@.P1 nvarchar(38),@.P2 nvarchar(30),@.P3 int,@.P4 int,@.P5 int', N'{FFC28EAD-1134-40BB-9723-7D88A0B0AC7A}', N'Tile1', 197, 183, 156 Microsoft Access sa 0 11 0 0 2564 54 2004-06-21 10:35:14.170

SQL:BatchCompleted IF @.@.TRANCOUNT > 0 ROLLBACK TRAN Microsoft Access sa 0 0 0 0 2564 54 2004-06-21 10:35:19.403

- Brad|||You say that pasting the data one row at a time from within ms access works ok?

If so, maybe you could also perform a sql trace on this and see what is different?|||I got it figured out. (BTW, I did the trace with the pasting but the results were ... confusing)

Apparently a bit field in SQL server can be Null?

There are two additional fields in the SQL version of the table. The NVarChar field I had set to allow nulls. I never bothered with the Bit field.

When I checked Allow Nulls on the bit field and re-linked, my query worked.

I guess my lesson her is never assume anything. I have learned that lesson many times and will probably learn it again in the (near) future.

Thanks for your help,
Brad

Monday, February 13, 2012

app_data: a strange folder

hi,

I noticed that inVWD i can create my sql database and place it in a special folder called app_data, what is this new?
i think it is imposible because sql server is a serverdb and not a file based db like access!It's for Sql Express 2005, which is more or less a file DB. Also, the default membership provider model takes advantage of SQL Express 2005 (ASPNETDB.MDF file) automatically created under this directory.|||what are the main differences between "normal" and express edition, which is more performant?
does sql eXpress allow external connections (webs in other servers or clients)?|||It's still a server-based db, that's just it's data file. The server process will just spawn when you first try to access it.

Thursday, February 9, 2012

Anyone who can help me the solve the strange problem

Hi,

i encountered a very strange problem when using SSIS, the oledb source convert some fields in retrieving the data from oracle database,the datatype of the target field is NUMBER(5,1), and all the data retrieved from it have the uniform 'x.y', and remained same when i previewed the data in the oledb source,but the output of the data changed to 'x', the data converted to integer, anyone knows how to solve the problem please let me know, thanks a lot.

Where is this output that you are looking at ? The output of the OLE DB Source?

If so, it could be that the externl columns have been mapped to the wrong pipeline types. Check this out in the OLE DB Source Advanced Editor.

-Jamie

|||Do you have anything between the source and destination that might be converting the data?|||

Jamie Thomson

thanks for your kindly help, the problem i mentioned above has been solved.

|||

icewill wrote:

Jamie Thomson

thanks for your kindly help, the problem i mentioned above has been solved.

Icewill,
I 've the same problem, question how did you solved it?
Thanks in advance.
Olaf

Anyone who can help me the solve the strange problem

Hi,

i encountered a very strange problem when using SSIS, the oledb source convert some fields in retrieving the data from oracle database,the datatype of the target field is NUMBER(5,1), and all the data retrieved from it have the uniform 'x.y', and remained same when i previewed the data in the oledb source,but the output of the data changed to 'x', the data converted to integer, anyone knows how to solve the problem please let me know, thanks a lot.

Where is this output that you are looking at ? The output of the OLE DB Source?

If so, it could be that the externl columns have been mapped to the wrong pipeline types. Check this out in the OLE DB Source Advanced Editor.

-Jamie

|||Do you have anything between the source and destination that might be converting the data?|||

Jamie Thomson

thanks for your kindly help, the problem i mentioned above has been solved.

|||

icewill wrote:

Jamie Thomson

thanks for your kindly help, the problem i mentioned above has been solved.

Icewill,
I 've the same problem, question how did you solved it?
Thanks in advance.
Olaf