Showing posts with label working. Show all posts
Showing posts with label working. Show all posts

Friday, March 30, 2012

problem with SQLConnection

I am working on a set of webforms that insert user data into a set of db tables.

I set up a test of an approach using northwind and I'm having trouble getting the insert to work. When I open the form, input the name and phone, and submit there is no error, but no record inserted into the Shippers table.

You can see one of my approaches in the ASPX code. I don't like having to do the select in order to do the insert -- so that's commented off.

I'm stuck. Thoughts about what I'm missing appreciated...

Ray

ASPX code.

<%@.PageLanguage="C#"AutoEventWireup="true"CodeFile="Default66a.aspx.cs"Inherits="pages_audit_Default66a" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headid="Head1"runat="server">

<title>Untitled Page</title>

</head>

<body>

<formid="form1"runat="server">

CompanyName:

<asp:textboxid="txtCompanyName"runat="server"/><br/>

Phone:

<asp:textboxid="txtPhone"runat="server"/><br/>

<br/>

<asp:buttonid="btnSubmit"runat="server"text="Submit"onclick="btnSubmit_Click"/>

<br/>

<br/>

<br/>

<br/>

<asp:LabelID="awesomelbl"runat="server"Text="Label"></asp:Label><br/>

<br/>

<!--

<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:NorthwindConnectionString %>"

insertcommand="INSERT INTO Shippers(CompanyName, Phone) VALUES (@.CompanyName, @.Phone)" ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [Shippers]">

<insertparameters>

<asp:controlparameter controlid="txtCompanyName" name="CompanyName" />

<asp:controlparameter controlid="txtPhone" name="Phone" />

</insertparameters>

</asp:sqldatasource>

-->

</form>

</body>

</html>

c Sharp code

using System;

using System.Data;

using System.Data.SqlClient;

using System.Data.Sql;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

publicpartialclasspages_audit_Default66a : System.Web.UI.Page

{

protectedvoid Page_Load(object sender,EventArgs e)

{

}

protectedvoid btnSubmit_Click(object sender,EventArgs e)

{

SqlConnection con =newSqlConnection("Data Source=Chilibowl;Trusted_Connection=yes;DataBase=Northwind");

SqlCommand cmd =newSqlCommand("INSERT INTO [Shippers] ([CompanyName], [Phone]) VALUES (@.CompanyName, @.Phone)");

SqlParameter cnameparam =newSqlParameter("@.CompanyName", txtCompanyName.Text);SqlParameter phnparam =newSqlParameter("@.Phone", txtPhone.Text);

cmd.Parameters.Add(cnameparam);

cmd.Parameters.Add(phnparam);

try

{

con.Open();

if (cmd.ExecuteNonQuery() > 0)awesomelbl.Text ="successful insert";

}

catch

{

//handel

}

finally

{

con.Close();

}

}

}

rkobs:

SqlCommand cmd =newSqlCommand("INSERT INTO [Shippers] ([CompanyName], [Phone]) VALUES (@.CompanyName, @.Phone)");

Try this:

SqlCommand cmd =newSqlCommand("INSERT INTO [Shippers] ([CompanyName], [Phone]) VALUES (@.CompanyName, @.Phone)",con);

|||

Worked. Thanks.

Ray

sql

Problem with sql2005 query/storedproc

I am working on the login portion of my app and am using my own setup for the moment so that I can learn more about how things work. I have 1 user setup in the db and am using a stored procedure to do the checking for me, here is the stored procedure code:

ALTER PROCEDUREdbo.MemberLogin(@.MemberNamenchar(20),

@.MemberPasswordnchar(15),

@.BoolLoginbit OUTPUT

)

AS

selectMemberPasswordfrommemberswheremembername = @.MemberNameandmemberpassword = @.MemberPassword

if@.@.Rowcount = 0

begin

selectBoolLogin = 0

return

end

selectBoolLogin=1

/* SET NOCOUNT ON */

RETURN

When I run my app, I continue to get login failed but no error messages. Can anybody help? Here is my vb code:

Dim MemberNameAsString

Dim MemberPasswordAsString

Dim BoolLoginAsBoolean

Dim DBConnectionAsNew Data.SqlClient.SqlConnection(MyCONNECTIONSTRING)

Dim SelectMembersAsNew Data.SqlClient.SqlCommand("MemberLogin", DBConnection)

SelectMembers.CommandType = Data.CommandType.StoredProcedure

MemberName = txtLogin.Text

MemberPassword = txtPassword.Text

Dim SelectMembersParameterAs Data.SqlClient.SqlParameter = SelectMembers.CreateParameter

'Name

SelectMembersParameter.ParameterName ="@.MemberName"

SelectMembersParameter.Value = MemberName

SelectMembers.Parameters.Add(SelectMembersParameter)

'Password

Dim SelectPasswordParameterAs Data.SqlClient.SqlParameter = SelectMembers.CreateParameter

SelectPasswordParameter.ParameterName ="@.MemberPassword"

SelectPasswordParameter.Value = MemberPassword

SelectMembers.Parameters.Add(SelectPasswordParameter)

Dim SelectReturnParameterAs Data.SqlClient.SqlParameter = SelectMembers.CreateParameter

SelectReturnParameter.ParameterName ="@.BoolLogin"

SelectReturnParameter.Value = BoolLogin

SelectReturnParameter.Direction = Data.ParameterDirection.Output

SelectMembers.Parameters.Add(SelectReturnParameter)

If BoolLogin =FalseThen

MsgBox("Login Failed")

ElseIf BoolLogin =TrueThen

MsgBox("Login Successful")

EndIf

EndSub

Thank you!!!

Perhaps its because of the nchar's you are using. CHAR is used for a fixed width string so if you send in a string which is less than the specified length it will be padded with extra spaces at the end. I would modify your code as follows:

ALTER PROCEDURE dbo.MemberLogin(@.MemberNamenvarchar(20),@.MemberPasswordnvarchar(15),@.BoolLoginbit OUTPUT)ASBEGINSET NOCOUNT ON-- @.BoolLogin =0 ==> Does not exist, @.BoolLogin=1 ==> ExistsSET @.BoolLogin =0IFEXISTS(select MemberPasswordfrom memberswhere membername = @.MemberNameand memberpassword = @.MemberPassword)SET @.BoolLogin = 1SET NOCOUNT OFFEND
|||

Hello all, I am still having problems and am very frustrated. I have looked and ready over a dozen articles on ado/asp/sql and cannot seem to figure this out. I have a sql db I added using the add components part of asp. It is local, IIS is active. As far as i can tell servername is 'local'. This is the code I am running:

visual basic code:
Imports System.DataImports System.Data.SqlClientPartialClass _DefaultInherits System.Web.UI.PagePrivateConst MyCONNECTIONSTRINGAsString = "Server=(local);Database=Vex;Trusted_Connection=True"ProtectedSub btnLogin_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)Handles btnLogin.ClickDim MemberNameAsStringDim MemberPasswordAsStringDim BoolLoginAsBooleanDim testAsStringDim DBConnectionAsNew Data.SqlClient.SqlConnection(MyCONNECTIONSTRING)Dim SelectMembersAsNew Data.SqlClient.SqlCommand("MemberLogin", DBConnection) SelectMembers.CommandType = Data.CommandType.StoredProcedure 'open the connection to the db DBConnection.Open() MemberName = txtLogin.Text MemberPassword = txtPassword.Text 'NameDim SelectMembersParameterAs Data.SqlClient.SqlParameter = SelectMembers.CreateParameter SelectMembersParameter.ParameterName = "@.MemberName" SelectMembersParameter.Value = MemberName SelectMembers.Parameters.Add(SelectMembersParameter) 'PasswordDim SelectPasswordParameterAs Data.SqlClient.SqlParameter = SelectMembers.CreateParameter SelectPasswordParameter.ParameterName = "@.MemberPassword" SelectPasswordParameter.Value = MemberPassword SelectMembers.Parameters.Add(SelectPasswordParameter) 'Pass or Fail VariableDim SelectReturnParameterAs Data.SqlClient.SqlParameter = SelectMembers.CreateParameter SelectReturnParameter.ParameterName = "@.BoolLogin" SelectReturnParameter.Value = BoolLogin SelectReturnParameter.Direction = Data.ParameterDirection.Output SelectMembers.Parameters.Add(SelectReturnParameter) test = SelectMembers.ExecuteScalar()EndSubEndClass

I get this error when i try to login on the .open line:

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)

If i try to execute the .scalar w/o the line it tells me i need an open connection, but when I try to open the connection it throws this error. What am I doing wrong? Is there some setup piece(s) I am missing? I have gone through a basic install of vs2005 with no settings changes to sql05. Any help is greatly appreciated as I am at my wits end with this and I know it is going to be something simple......

as an added note, here is the connection string in the web.config file:

visual basic code:
<connectionStrings> <add name="csVex" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Vex.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /> </connectionStrings>
I went into sql2005 surface configuration and made sure all protocols are enabled. I am an admin locally on my machine. I do not know what else to check or do at this point.

Thanks for your help....

|||

Just in case anybody else runs into this. I created a new project and added a datasource to that project pointing to my sql 2005 database. I then copied the connectionstring from that connection and pasted it in my CONST connectionstring. Error went away.

Good Luck!!

Wednesday, March 28, 2012

Problem with SQL Server 2005 Express

Hello,

I am programmer from Bulgaria and I am new in working with SQL server. I have a problem and want to discuss.

Imagine that there is software system working on Windows XP professional, SQL Server 2005 express database, programs (source code on Microsoft C/C++) that connect to SQL Server 2005 express via ODBC and around 30 users that working 24 hours a day.

For simplicity let imagine that in database have 2 main tables. In first table users add record. The program get value of certain field from that record and add that value to certain field in existing record in second table. (For example => imagine that in first table insert record for sell of some good /document of sell/ and in the second table contain all amount of sells of that good.)

Everything goes fine and working very well, but sometimes (3 or 4 times a day) the data of second table don’t add the value. The users get angry and say that they have not security in the data. And I don’t know what to do, because the program is the same, only database is changed before a month to SQL Server 2005 express (before there was Access database).

Every update/change in database stays with transactions.

Please help me to resolve that problem. Have someone the same problem? Or may be I must make some settings in database, or in transaction manager (MSDTC), or etc.?

Greetings to everybody!

hi,

you do not say how you propagate the update to the 2nd table...

is there a trigger on the very fist table or do you just execute 2 UPDATE STATEMENTS?

check your code to verify the 2 updates stay in the very same transaction as well..

regards

|||

Hi Andrea,

The software system that I am talking about has strong rules to modify database and nobody else outside that software system don’t modify database.

And because the system is complex I give an example only with 2 tables. In fact there are several tables in which the system add different certain fields. Every updates/modify of the tables stay in the body of transaction.

transaction per 1 record:

1. begin transaction

2. many changes (insert, delete and update records) on related tables

3. commit transaction

When I put the system on the test with test data everything is ok. When the users start to input data and get the results (reports and etc.) in real work everything is ok.

The problem is that sometimes transactions don’t work. (If for some document transaction not working and after that the same document are input again with the same conditions into the system => everything is ok for second case, but for first case have document and amount is not added).

For example =>

- the specialist for deliver of goods inputs document for deliver of goods and show me printed stores document that system print, but that quantity don’t go to store and trader can’t sell

- or trader make selling of goods and show me printed invoice that the system print, but the quantity in the store don’t decrease and he don’t know what quantity of goods are in the sore.

- or in account department account clerk make payment to some invoice and show me input document into the system for payment, but the invoice stays unpaid.

- into the manufacture are the same cases – in the system have document for production, but sometimes quantity of the production not go to the store and traders cant sell.

And etc.

If there was single case I will think that it is error of specialist that input data into the system. But it is system that works on heavy conditions – many documents are input ant people with different occupation working together into one software system and make management decisions. Therefore I think inaccuracy like this is unallowable.

May be triggers will solve the problem, but some parts of the software system must be develop again. (Still more that this system worked very well with Access database)

I need more ideas.

Thank you and regards.

|||

hi,

I do think you probably have to check your application code, as it seems transactions got broken and not rolled back for the entire enlisted actions...

but it's very difficult in this scenario to point a finger somewhere..

regards...

|||

Hi Andrea,

I check ones again all source code that include input execute actions into transactions. There I don’t find any problem. But I see that the transactions are in the body of thread. This is because to avoid decrease of speed when many users working at the same time (in my servers program).

So, I remove threads and let the transactions run on the main program. Now I am waiting for results of the real work.

/This will decrease speed of my servers program because until the program run execute actions from one user without threads (in main servers program) the other users will wait/

May be the problem is when the transactions run in the body of threads.

I hope that someone from Microsoft corp. will check the situation – many transactions in the body of many threads – is there some problems?

Regards!

sql

Problem with SQL Server 2005 Express

Hello,

I am programmer from Bulgaria and I am new in working with SQL server. I have a problem and want to discuss.

Imagine that there is software system working on Windows XP professional, SQL Server 2005 express database, programs (source code on Microsoft C/C++) that connect to SQL Server 2005 express via ODBC and around 30 users that working 24 hours a day.

For simplicity let imagine that in database have 2 main tables. In first table users add record. The program get value of certain field from that record and add that value to certain field in existing record in second table. (For example => imagine that in first table insert record for sell of some good /document of sell/ and in the second table contain all amount of sells of that good.)

Everything goes fine and working very well, but sometimes (3 or 4 times a day) the data of second table don’t add the value. The users get angry and say that they have not security in the data. And I don’t know what to do, because the program is the same, only database is changed before a month to SQL Server 2005 express (before there was Access database).

Every update/change in database stays with transactions.

Please help me to resolve that problem. Have someone the same problem? Or may be I must make some settings in database, or in transaction manager (MSDTC), or etc.?

Greetings to everybody!

hi,

you do not say how you propagate the update to the 2nd table...

is there a trigger on the very fist table or do you just execute 2 UPDATE STATEMENTS?

check your code to verify the 2 updates stay in the very same transaction as well..

regards

|||

Hi Andrea,

The software system that I am talking about has strong rules to modify database and nobody else outside that software system don’t modify database.

And because the system is complex I give an example only with 2 tables. In fact there are several tables in which the system add different certain fields. Every updates/modify of the tables stay in the body of transaction.

transaction per 1 record:

1. begin transaction

2. many changes (insert, delete and update records) on related tables

3. commit transaction

When I put the system on the test with test data everything is ok. When the users start to input data and get the results (reports and etc.) in real work everything is ok.

The problem is that sometimes transactions don’t work. (If for some document transaction not working and after that the same document are input again with the same conditions into the system => everything is ok for second case, but for first case have document and amount is not added).

For example =>

- the specialist for deliver of goods inputs document for deliver of goods and show me printed stores document that system print, but that quantity don’t go to store and trader can’t sell

- or trader make selling of goods and show me printed invoice that the system print, but the quantity in the store don’t decrease and he don’t know what quantity of goods are in the sore.

- or in account department account clerk make payment to some invoice and show me input document into the system for payment, but the invoice stays unpaid.

- into the manufacture are the same cases – in the system have document for production, but sometimes quantity of the production not go to the store and traders cant sell.

And etc.

If there was single case I will think that it is error of specialist that input data into the system. But it is system that works on heavy conditions – many documents are input ant people with different occupation working together into one software system and make management decisions. Therefore I think inaccuracy like this is unallowable.

May be triggers will solve the problem, but some parts of the software system must be develop again. (Still more that this system worked very well with Access database)

I need more ideas.

Thank you and regards.

|||

hi,

I do think you probably have to check your application code, as it seems transactions got broken and not rolled back for the entire enlisted actions...

but it's very difficult in this scenario to point a finger somewhere..

regards...

|||

Hi Andrea,

I check ones again all source code that include input execute actions into transactions. There I don’t find any problem. But I see that the transactions are in the body of thread. This is because to avoid decrease of speed when many users working at the same time (in my servers program).

So, I remove threads and let the transactions run on the main program. Now I am waiting for results of the real work.

/This will decrease speed of my servers program because until the program run execute actions from one user without threads (in main servers program) the other users will wait/

May be the problem is when the transactions run in the body of threads.

I hope that someone from Microsoft corp. will check the situation – many transactions in the body of many threads – is there some problems?

Regards!

Problem with SQL server - Excel

Hi to all! I am working with SQL server 2000 and up until today, I used to import data in the Server using an Excel Spreadsheet, and the wizard. Last time today, that I tried to do that, I got the following message:

" The instruction at "0x02e21b80" referenced memory at "0x02e21b80". The memory could not be "read".

Any help, would be much appreciated! I am stuck here, and the most akward thing, is that up until today, I kept on importing data from Excel, with the same process with no problem...

Anyway, I thank everyone in advance, just for taking the time to read this thread! :DThe error you describe is a very common error that really is saying "something went wrong and I don't have a clue what to do about it". It probably won't fix if you try again, and it will probably not work if you try to restart your computer (but it might, it has happened to me). I'm assuming that this problem is related to your workstation in some way, removed dll's, uninstalled program that messed up something you needed or something similar.
To rule out possibilities, I would try to do the same thing from another computer. If that works, I'd try to reinstall Excel, and if it didn't work, I'd check out the access privileges the account uses that makes the database connection. Just some tips ... ;)|||Thanks a lot! I'll try doing these things and see what happens!

You' ve offered great help to me, cause I'm in a state of confusion at the moment and I wasn't able to think clearly!

Thanks! :)

Wednesday, March 21, 2012

Problem with SMO on a ASP.NET page

Hi !

I have done an EXE which copy a database using SMO. When i double click my exe everything is working fine. If i tried to execute my EXE in a ASP.NET web page the process is start but doesn't do anything. If i tried other EXE i've made it's working fine so the problem seems to come from SMO. Did i have something to add to my code if i want to use it in a webpage ?In common no, did you try to debug the SMO application / library which you wrote ?

HTH, jens Suessmeyer.

http://www.sqlserver2005.de|||

Thanks !

I've figure out what was the problem. To be able to use my EXE in my web application i've got to add those lines

myServer.ConnectionContext.LoginSecure = False

myServer.ConnectionContext.Login = "****"

myServer.ConnectionContext.Password = "*****"

Now my EXE is working fine when i'm calling it from my webapplication

Problem with Simple Query

Hi

I'm executing the following query on table OMS_SITEVISIT_ITEMLIST, and it just ain't working. I have tested this in Enterprise Manager.

SELECT *
FROM OMS_SITEVISIT_ITEMLIST
WHERE (eFolderID = 'LAPTOP$LAPTOP$00000956')
AND (InStock <> - 1)

I have 3 rows where eFolderID = 'LAPTOP$LAPTOP$00000956' and InStock is NULL. So in theory it should pull back 3 rows, but it doesn't pull any. It does pull back 3 rows if i remove the reference to InStock (which is of type SMALLINT, length 2), so it's the second part of the WHERE clause that's causing the problem.

Can anyone see where I might be going wrong?

Cheers
GregTry this lets see...

SELECT *
FROM OMS_SITEVISIT_ITEMLIST
WHERE (eFolderID = 'LAPTOP$LAPTOP$00000956')
AND isNull(InStock, Null) = Null|||I've come up with a workaround, and done away with the check on -1, but on 0 or NULL.

Thanks

Tuesday, March 20, 2012

Problem with select to another server.

Hello All!

This is the first time I'm working between two SQL servers. Here is a simple SELECT statement.

DECLARE @.Acct nvarchar(50)

SELECT First_Name, Last_Name, Age, DOB, Account_Number

FROM [MKE01-Demo-XX].SAHPharm.dbo.Active_Orders

WHERE [MKE01-2NX2461].[Pharm Test Local].dbo.Active_Orders = @.Acct

Here is the error

Msg 4104, Level 16, State 1, Line 4

The multi-part identifier "MKE01-2NX2461.Pharm Test Local.dbo.Active_Orders" could not be bound.

What am I doing wrong?

Thanks!

Rudy

MKE01-2NX2461 is set up as a Linked Server in MKE01-Demo-XX?

|||

You are attempting to compare a table to a variable.

WHERE [MKE01-2NX2461].[Pharm Test Local].dbo.Active_Orders = @.Acct

It would be nice, but it isn't going to happen...

But more critically, I don't see any relationship between the two tables from the two databases. How would a row from [MKE01-2NX2461].[Pharm Test Local].dbo.Active_Orders be connected to the table [MKE01-Demo-XX].SAHPharm.dbo.Active_Orders in such a way that using the variable value against one table 'should' return a row from the other table.

I think that something isn't quite right here... (Perhaps a JOIN is missing.)

|||

Hi guys!

Ah yes. A JOIN would make sense. Mke Demo is the linked serve on MKe 29nx... So let me give that a shot. I'm sure I'll be back here with a question or two.

Thanks!

Rudy

|||

Perhaps something more like this?

Code Snippet


DECLARE @.Acct nvarchar(50)


SET @.Acct = {someValue}


SELECT
x.First_Name,
x.Last_Name,
x.Age,
x.DOB,
x.Account_Number
FROM [MKE01-Demo-XX].SAHPharm.dbo.Active_Orders x
JOIN [MKE01-2NX2461].[Pharm Test Local].dbo.Active_Orders t
ON x.Account_Number = t.Account_Number
WHERE x.Account_Number = @.Acct

This assumes that the values you wish to return are located in the [MKE01-Demo-XX].SAHPharm.dbo.Active_Orders table, and that both tables have the Account_Number column to link the data.

Wednesday, March 7, 2012

Problem with Remote Connections with SQL Server 2005 Standard Edition

After applying the changes mentioned in KB 914277 to allow remote connections, while working in Visual Studio 2005, I'm now getting an error with the number 26: Error locating server/Instance specified...

Sure wish I knew what remote means in this scenario, as there is nothing "remote" about my installation. I only have 1 computer, the one i'm working on, where SQL Server and Visual Studio are installed, and no networks involved, so what is remote?

Any help would be appreciated!!

If the sql server you are trying to connect to and the app you are running are on the same physical machine then you do not need to config remote connections.

Can you check if the SQL Server is still running via the services.msc or config manager first of all.

|||

If there is a way of telling SQL Server that I don't need any remote connection, I'd be more than happy to use it.

However I don't know how to do that... therefore I got the error-message about the remote connection.

How do I tell SQL Server there is no need for a remote connection?

Thanx!!

|||Use the surface area config tool|||

And then...

Check what, click what, do what?

I've only been able to install SQL Server, with a lot of coaching from this forum, I've never used it, and have no idea what makes it or any of it's utilities tick...

I'm thankful for any advice I've been given, but I have no idea what to do with the Surface Area tool, when I get there...

|||

Hello Layne - I got your e-mail about still not being able to connect. Without more information, this will be hard for everyone to help you with. But before I give you some more pointers, you should know about a couple of things.

First, this isn't the primary mechanism for support for Microsoft products. Everyone here is happy to help out where we can, but it's a free site where Microsoft and other database folks will try and help you. We'll do what we can to help you, but there are no guarantees. Microsoft hosts these sites (again, at no cost to you) but this isn't the primary method they support their products. If you need immediate assistance you can check out several support options at http://www.microsoft.com/support.

I also think the comments in your e-mail to me about "all of us going back to India" isn't very polite. If you're asking for help (for free), you may want to be complimentary rather than derogatory. It will get you more answers faster to be polite to others.

The best place for you to look for what you're asking is:

http://msdn.microsoft.com/vstudio/express/sql/learning/default.aspx

It's on Express, but will help you with your edition as well.

|||

If the problem is just remote connection is not allowed on the remote server read and check whether the remote server is configured as in the following article http://www.kodyaz.com/content/SQLServerdoesnotallowremoteconnections.aspx but it seems that you are hitting another problem

Problem with Remote Connections with SQL Server 2005 Standard Edition

After applying the changes mentioned in KB 914277 to allow remote connections, while working in Visual Studio 2005, I'm now getting an error with the number 26: Error locating server/Instance specified...

Sure wish I knew what remote means in this scenario, as there is nothing "remote" about my installation. I only have 1 computer, the one i'm working on, where SQL Server and Visual Studio are installed, and no networks involved, so what is remote?

Any help would be appreciated!!

If the sql server you are trying to connect to and the app you are running are on the same physical machine then you do not need to config remote connections.

Can you check if the SQL Server is still running via the services.msc or config manager first of all.

|||

If there is a way of telling SQL Server that I don't need any remote connection, I'd be more than happy to use it.

However I don't know how to do that... therefore I got the error-message about the remote connection.

How do I tell SQL Server there is no need for a remote connection?

Thanx!!

|||Use the surface area config tool|||

And then...

Check what, click what, do what?

I've only been able to install SQL Server, with a lot of coaching from this forum, I've never used it, and have no idea what makes it or any of it's utilities tick...

I'm thankful for any advice I've been given, but I have no idea what to do with the Surface Area tool, when I get there...

|||

Hello Layne - I got your e-mail about still not being able to connect. Without more information, this will be hard for everyone to help you with. But before I give you some more pointers, you should know about a couple of things.

First, this isn't the primary mechanism for support for Microsoft products. Everyone here is happy to help out where we can, but it's a free site where Microsoft and other database folks will try and help you. We'll do what we can to help you, but there are no guarantees. Microsoft hosts these sites (again, at no cost to you) but this isn't the primary method they support their products. If you need immediate assistance you can check out several support options at http://www.microsoft.com/support.

I also think the comments in your e-mail to me about "all of us going back to India" isn't very polite. If you're asking for help (for free), you may want to be complimentary rather than derogatory. It will get you more answers faster to be polite to others.

The best place for you to look for what you're asking is:

http://msdn.microsoft.com/vstudio/express/sql/learning/default.aspx

It's on Express, but will help you with your edition as well.

|||

If the problem is just remote connection is not allowed on the remote server read and check whether the remote server is configured as in the following article http://www.kodyaz.com/content/SQLServerdoesnotallowremoteconnections.aspx but it seems that you are hitting another problem

problem with rank on freetexttable

Hello,

I'm having a problem that I'm hoping one of the Sql Server guru's on this forum can help me with. This applies to SQL Server 2005.

I'm working on an appliction that used the FTE index ranking feature. We're having a problem that all of the rank values start coming back as ZERO. If we rebuild the index for the effected table, the rank values start working, but eventually it stops working again. Recently, the rank values have been reverting to zero within a minute of the rebuild.

For reference, below is the sql code that we are using to get our search results.

select

row_number() over (order by RANK DESC) as rowNumber,

[KEY],

rank

from

freetexttable(searchIndex, *, 'outlook')

Here is the result that we get once the rankings stop working (sorry for the formatting, couldn't get it to paste good into the editor). All the rankings are zero:

rowNumber KEY rank

-- -- --

1 7 0

2 11 0

3 12 0

4 13 0

5 14 0

6 19 0

7 20 0

8 21 0

9 22 0

10 24 0

11 25 0

12 26 0

13 27 0

14 29 0

15 30 0

16 31 0

17 32 0

18 33 0

19 34 0

20 35 0

21 36 0

22 37 0

23 38 0

24 39 0

25 40 0

26 41 0

27 42 0

28 43 0

29 44 0

30 45 0

31 46 0

32 47 0

33 48 0

34 49 0

35 50 0

36 51 0

37 52 0

38 53 0

39 56 0

40 57 0

41 59 0

42 60 0

43 62 0

44 64 0

45 66 0

46 67 0

47 70 0

48 73 0

49 75 0

50 77 0

51 78 0

52 81 0

53 84 0

54 85 0

55 86 0

56 87 0

57 88 0

58 89 0

59 92 0

60 93 0

61 94 0

62 95 0

(62 row(s) affected)

Here is the result that we get immediately after rebuilding the FTE index. We get rankings for a brief time after the rebuild:

rowNumber KEY rank

-- -- --

1 25 885

2 89 878

3 12 866

4 57 860

5 66 860

6 95 849

7 44 849

8 92 843

9 88 843

10 85 818

11 33 818

12 26 818

13 94 808

14 84 805

15 52 805

16 56 805

17 14 805

18 41 805

19 46 805

20 47 805

21 51 782

22 29 778

23 31 763

24 48 763

25 50 763

26 42 763

27 39 763

28 35 763

29 81 763

30 73 729

31 20 729

32 7 729

33 22 727

34 11 692

35 40 692

36 43 692

37 38 692

38 49 692

39 53 692

40 59 692

41 87 692

42 36 677

43 37 673

44 34 673

45 45 673

46 13 673

47 86 673

48 93 673

49 60 642

50 62 617

51 21 617

52 30 583

53 64 583

54 75 529

55 70 529

56 32 529

57 24 529

58 27 529

59 19 529

60 77 516

61 78 473

62 67 473

(62 row(s) affected)

Any help would be greatly appreciated.

Thanks.

Mike

Did you turn on pre computed rank? Does this repro if you omit the row_number() column?

Also, can you do a master merge to see if the problem repros?

|||

Hi Feng,

Thanks so much for replying. Sorry for the delayed response.

I did turn on precompute rank after reading your post but it didn't seem to make any difference. I had already established that omitting row_number() didn't help. One thing that is interesting is that the term 'outlook' seems to be what causes no ranks to be returned. When I do searches on other topics such as email, imap, or even 'outlook imap', I seem to get rankings. For me, this means that the problem is not a critical one, although I do wonder why its happening. It's almost as if SQL Server considers 'outlook' to be a noise word.

Any other advice would be gratefully received.

Thanks again.

Mike

|||

Is the index the only index in the catalog?

I cannot think of any reason why 'outlook' get the special treatment. We need a repro and data to dive deeper into the problem.

|||

Feng,

The index is the only one in the full text catalog. I do have a second full text catalog indexing another table.

Can you give me more detail on what you mean by "repro and data"?

Thanks.

Mike

|||Basically, I mean a small data set and a sql script that can reproduce the bug, so that we can debug it to see what is happening. If you can provide such a repro, please make it "generic", that is, strip out all the confidential/sensitive data -- otherwise I think you need to go through the formality of MS customer support.

Saturday, February 25, 2012

Problem with query

Hi,
I have a query that is supposed to return records and make a left join where
one field is not null, but for some reason is not working properly and
returns the records even though they are null.
SELECT *
FROM cases a
left join activities as w on a.id = w.caseid AND w.Dateinitiated = (Select
MAX(y.Dateinitiated)
From Activities y Where y.caseid = a.id AND y.ActType ='HISTORY' and
y.dateinitiated IS NOT NULL and y.processtep IS NOT NULL)
Any help is greately appreciated.
AleksAleks,
The reason the query seems to be returnning records from Activities,
where the Dateinitiated column is null, is because you have specified an
Outer Join.
When you specify An Outer Join, Al records from the Outer table are
returned, even when there is no match on the other side. You actually are
NOT returning any data from Activities Table where Dateinitiated column is
null. If you look at those rows, you'll probably notice that all the field
s
from Activities table are null there...
"Aleks" wrote:

> Hi,
> I have a query that is supposed to return records and make a left join whe
re
> one field is not null, but for some reason is not working properly and
> returns the records even though they are null.
> --
> SELECT *
> FROM cases a
> left join activities as w on a.id = w.caseid AND w.Dateinitiated = (Select
> MAX(y.Dateinitiated)
> From Activities y Where y.caseid = a.id AND y.ActType ='HISTORY' and
> y.dateinitiated IS NOT NULL and y.processtep IS NOT NULL)
> --
> Any help is greately appreciated.
> Aleks
>
>

Problem with Publication Articles being deleted

I wonder if anyone can advise, I currently have a replication set to 5 offices. Which has been working fine for some 18 months+, then the replication dropped out. When I looked in the publisher it had lost all its articles and would not allow me to add back in. I deleted the publication and recreated it and then after creating a new snapshot starting rolling back out to the various locations, and one of the locations failed and again all the articles where lost. I deleted and rebuilt the database at that office and went through the same routine again, only for it to happen again, the issue being that now errors where produced!!!.

So at present I have the publication and all the subscriptions running apart from this one office.

Has anyone had this before, or any ideas. I have run a full virus scan just in case and it was fine.

Can you provide more information?

Are you using push transactional replication?

Where does the replication fail? What error messages are you getting?

When you say one of the location failed, does it mean other locations worked fine?

Gary

|||

Hi Gary,

I found the problem, they were two dns records for the server I was trying to replicate to, and one of the records pointed back to the publication server. Now just need to find why all of a sudden I have 2 DNS records.

Thanks

Tony

Monday, February 20, 2012

Problem with PDF Exports in RS 2000 SP2....

Hello All,

when we export to pdf, keeptogether functionality is not working properly in Table.Is this fixed in RS2005?

Does anyone know when rs2005 will be released?.

Thanks in Advance.

rs2005 was released with SQL2005 together some months ago.|||

Hi,

Keeptogether is not working for report export to PDF in VS2005... I have a 4 column report and the List (with embedded List) does not wrap as I expected with Keeptogether=False. Am I doing something wrong? Is there a trick I'm missing.

Thanks.... Frank

|||I have this problem too, in SRS2005, list w/ embedded list acts as if keeptogether is on when export to PDF or print. Mine is only 1 column. Did you ever find a solution? Possibly a bug with embedded lists?

Problem with PDF Exports in RS 2000 SP2....

Hello All,

when we export to pdf, keeptogether functionality is not working properly in Table.Is this fixed in RS2005?

Does anyone know when rs2005 will be released?.

Thanks in Advance.

rs2005 was released with SQL2005 together some months ago.|||

Hi,

Keeptogether is not working for report export to PDF in VS2005... I have a 4 column report and the List (with embedded List) does not wrap as I expected with Keeptogether=False. Am I doing something wrong? Is there a trick I'm missing.

Thanks.... Frank

|||I have this problem too, in SRS2005, list w/ embedded list acts as if keeptogether is on when export to PDF or print. Mine is only 1 column. Did you ever find a solution? Possibly a bug with embedded lists?

Problem with PDF Exports in RS 2000 SP2....

Hello All,

when we export to pdf, keeptogether functionality is not working properly in Table.Is this fixed in RS2005?

Does anyone know when rs2005 will be released?.

Thanks in Advance.

rs2005 was released with SQL2005 together some months ago.|||

Hi,

Keeptogether is not working for report export to PDF in VS2005... I have a 4 column report and the List (with embedded List) does not wrap as I expected with Keeptogether=False. Am I doing something wrong? Is there a trick I'm missing.

Thanks.... Frank

|||I have this problem too, in SRS2005, list w/ embedded list acts as if keeptogether is on when export to PDF or print. Mine is only 1 column. Did you ever find a solution? Possibly a bug with embedded lists?

Problem with Padding Expression

Hi,
I am trying to use this "=17*Now.Date.Month" in Left Padding of a textbox.
But it is not working.
Even "=17*3" does not work.
Any ideas
Thanks
KiranThe Padding value needs to be a string with a size unit, e.g. 10 pt.
Try this: =CStr(17 * Month(Today)) + " pt"
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Kiran" <Kiran@.nospam.net> wrote in message
news:%23QxPZFO5EHA.2196@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I am trying to use this "=17*Now.Date.Month" in Left Padding of a textbox.
> But it is not working.
> Even "=17*3" does not work.
> Any ideas
> Thanks
> Kiran
>