Showing posts with label net. Show all posts
Showing posts with label net. Show all posts

Thursday, March 29, 2012

General Network Error. Check your network documentation

Hi,

I am using .Net 1.1 for my web application.

And my database server is SQL Server 2005.

My application is running fine, as i can login to it and also able to view pages. But when i open Order management(having 3K records) its give me error,

General Network Error. Check your network documentation

I have also searched many articles and tried following solutions but nothing working

- connectiontimeout = 0, max pool size = 7500/100, pooling = false

- SSL disabling enforce security false as mentioned in microsoft kb article.

And there's nothing any issue with hardware/firewall as my application's login and other forms are working fine(which use same database with same connection string)

Can any one please help me to solve this error?

Hi,

Correct me if I am wrong but are you trying to load 3000 records onto a page. If so there is a limit to the number of data records that a page can hold and this may be your problem. Have you tried paging the results so that you only get about 100 or 500 records per page.

Regards

Scottyb

|||

Hi,

Finally i got solution.

that rather then adding connectiontimeout = 0 in connection string.

We have to assign it in command property.

cmd.ConnectionTimeout = 0

because if we didn't assign in command microsoft internally set it's default value.

If you see SqlCommand class code by disassemble, in it's constructor it set this property to 30.
so if you not assign value 0 its default value is 30. it can not take value from connection string.

And it's working fine.

Finally i got so now i can take breath, otherwise my client calling me every 15-20 mins for solution.


General Network Error Randomly But Consistantly

We have a .net 1.1 application that gets this both with MSDE and SSE but more with SSE.

It randomly crashes with this error on laptops where they have SSE or MSDE installed on the local computer. They're being referenced by the machineName\Instance because (Local)\Instance had bugs in the past with network connections disappearing and us getting this error.
Now we're getting this, especially with Intel Wireless Cards on a random but consistant basis.

Under SSE we've had to turn on tcp/ip to make our app run, which tells me that something is preventing it from using shared memory access, which I suspect is that we're not using (Local)\Instance, so I tried switching it, and no dice, same problem.

Is anyone else getting this? It's driving us nuts!!!! (and pissing off customers)Are your laptops running Windows XP SP2? Check the firewall if you have allowed the port for SQL Server|||

With respect to SSE, what I would recommend to try is specifying the named pipe protocol in your connection string by adding "Network Library=dbnmpntw;" to your connection string.

If that connects successfull you should be able to turn off TCP/IP on your SSE.

|||Thanks! I'll try that. The firewall was open (but shouldn't have to be because it's local to local...) so I guess using named pipes (which I think is faster anyhow no?) probably can work around it.

Thanks!

general network error on asp .net 1.1

hi guys

i am developing my application on framework 1.1 on asp .net

i am trying to connect to sql server 2005 but it gives me error like general network error check your network documentation.

does any one know how to solve this error then pl reply fast

Is SQL Server on your local machine or on a remote server? Make sure the name or IP of the server is correct and that the port is open on any firewall. Try pinging the server to see if it responds.

General Network Error

Hello.

I'm running into a rather intermittent problem when a search query is run on an ASP.Net web application.

The error is 'General Network Error' Check your Network Documentation...

As I said, it doesn't happen everytime which leads me to beleive that there is a problem with the database connection

There's probably no more than 50-60 max users hitting the app at any one time.

Anybody familiar with this?

Those can be a real nightmare to debug... See if this helps you:
http://support.microsoft.com/default.aspx?scid=kb;en-us;875285

Tuesday, March 27, 2012

General Network Error

Hi,
we have written a vb.net program using SQL Server 2000 SP4 over OLEDB.
Our customer has a network which is sometimes quite instable. So we did
some tests in our office, because we wanted to help our customer by
redisigning some of our SQL calls.
When we start the program and disconnect the network cable then the
next SQL query will result in a General Network Error, which is
logical.
When we start the program, then disconnect the network cable for about
ten seconds, then reconnect it, then the next SQL query will also
result in the same error, which we already cannot understand.
When we do the same as above, but before the next SQL query we close
the connection and reopen it, we still get the same error, which is
strange.
When we close, dispose and then recreate and open the connection, then
assign the connection to a new command and execute the SQL command, we
still get the same error.
When we stop the program and restart it, we can reconnect to the
database.
But when starting the program, we do nothing else than creating and
opening a connection. So why does it not work to reconnect while the
program is running?
Any explanations or suggestions?
Many thanks.
Daniel.
Dear Daniel,
I got the same error with u , Did u solve the problem?
thanks
From Agnes
*** Sent via Developersdex http://www.codecomments.com ***
|||Hi Agnes,
Unfortunately I never have got an answer to this post. I also posted
similar requests to other forums, but I never have got any answer. So
our problem still persists.
Regards.
Daniel.

General network error

Hi,
I'am working with a merge Replication and a pull Subscription on demand from
the client
I'am getting this message error from a vb.net Windows Application
DATE=2006-03-15 15:18:34
ERROR=SyncJMI.CDatabaseUtils.LoadDataTable failed.
System.Data.SqlClient.SqlException: General network error. Check your
network documentation.
at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior behavior)
at
System.Data.SqlClient.SqlCommand.System.Data.IDbCo mmand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand
command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at SyncJMI.CDatabaseUtils.LoadDataTable(SqlCommand cmd, DataTable& dt,
Boolean verifyDb)
This is the first time a get this error
After doing some research on the Web, Ifind that if i put Polling=False in
my connection string this error dont appear anymore.
I'am not very confortable to deactivate the pooling for performance reason
Is this solution the real solution ?
Also by deactivating the pooling, does this deactivationis done on the
client side or server side?
It is a better idea to maximise the size of the pool instead of turn it off?
Thanks in advance!
I'm interested in any articles you can provide which show the connection
between General network error and connection pooling - haven't heard of this
as a solution myself before. Usually these issues concern breaks in
connectivity. If persistant then the network needs to be investigated. If
not, then simply restarting the merge agent suffices.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||My understanding is that connection pooling has advantages for other
connections using the same connection string properties, ie uid, pwd, or
trusted authentication. So the first connection in will spin up the min pool
size connections (default 1) and after it has complete its work subsequenct
connections with the same connection string can use that open connection.
What puzzles me is why are you using ado.net as opposed to the activex merge
replication objects? Its not clear to me that this is replication related or
ADO related. It seems to be barfing on LoadDataTable which doesn't sound
replication related.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
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
"GC" <GC@.discussions.microsoft.com> wrote in message
news:93AF91D3-59F6-4F1A-8DB3-A91C38DEDD57@.microsoft.com...
> Hi,
> I'am working with a merge Replication and a pull Subscription on demand
> from
> the client
> I'am getting this message error from a vb.net Windows Application
> DATE=2006-03-15 15:18:34
> ERROR=SyncJMI.CDatabaseUtils.LoadDataTable failed.
> System.Data.SqlClient.SqlException: General network error. Check your
> network documentation.
> at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
> cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
> at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
> behavior)
> at
> System.Data.SqlClient.SqlCommand.System.Data.IDbCo mmand.ExecuteReader(CommandBehavior
> behavior)
> at System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
> CommandBehavior behavior)
> at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand
> command, CommandBehavior behavior)
> at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
> at SyncJMI.CDatabaseUtils.LoadDataTable(SqlCommand cmd, DataTable& dt,
> Boolean verifyDb)
>
> This is the first time a get this error
> After doing some research on the Web, Ifind that if i put Polling=False
> in
> my connection string this error dont appear anymore.
> I'am not very confortable to deactivate the pooling for performance reason
> Is this solution the real solution ?
> Also by deactivating the pooling, does this deactivationis done on the
> client side or server side?
> It is a better idea to maximise the size of the pool instead of turn it
> off?
> Thanks in advance!
>
>
>
>
>
|||Let me explain,
We use a vb.Net application that execute some script,copy files,update
version of my vb.net application and so on.
After all update are up to date I call the pull subscription that update all
the records in the database
My application is there for maintenance purpose and for synchronisation of
the database
So the General Network error could arrive during an the execution of a
script like a store procedure etc... that have nothing to do with the
replication.
Still have the problem with the pooling
We have develop many application for customer and it is the first time i got
this error.
Hope this help you
"Hilary Cotter" wrote:

> My understanding is that connection pooling has advantages for other
> connections using the same connection string properties, ie uid, pwd, or
> trusted authentication. So the first connection in will spin up the min pool
> size connections (default 1) and after it has complete its work subsequenct
> connections with the same connection string can use that open connection.
> What puzzles me is why are you using ado.net as opposed to the activex merge
> replication objects? Its not clear to me that this is replication related or
> ADO related. It seems to be barfing on LoadDataTable which doesn't sound
> replication related.
> --
> Hilary Cotter
> Director of Text Mining and Database Strategy
> RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
> This posting is my own and doesn't necessarily represent RelevantNoise's
> positions, strategies or opinions.
> 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
>
> "GC" <GC@.discussions.microsoft.com> wrote in message
> news:93AF91D3-59F6-4F1A-8DB3-A91C38DEDD57@.microsoft.com...
>
>
|||did you monitor your connection pooling objects? This will reveal what if
your pool is exhausted.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
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
"GC" <GC@.discussions.microsoft.com> wrote in message
news:AE292989-2D5B-4A66-B8CF-EFD222B48808@.microsoft.com...[vbcol=seagreen]
> Let me explain,
> We use a vb.Net application that execute some script,copy files,update
> version of my vb.net application and so on.
> After all update are up to date I call the pull subscription that update
> all
> the records in the database
> My application is there for maintenance purpose and for synchronisation of
> the database
> So the General Network error could arrive during an the execution of a
> script like a store procedure etc... that have nothing to do with the
> replication.
> Still have the problem with the pooling
> We have develop many application for customer and it is the first time i
> got
> this error.
> Hope this help you
>
>
>
>
> "Hilary Cotter" wrote:

General Network Error

Hi,
I am occasionally getting the above error from an ASP.NET application that i
nserts documents into a SQL database. It had been running without this probl
em for several months and suddenly this problem has raised it's head twice i
n the last few days.
I have narrowed it down to happening when documents are being inserted into
the database, and while this is happening other queries can still be execute
d without any problems - including other inserts.
The full error message is as follows, where line 247 is the insert:
System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandle
dException was thrown. --> System.Data.SqlClient.SqlException: General netw
ork error. Check your network documentation.
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavio
r, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at aifl_na.downloadReadingTest2.Page_Load(Object sender, EventArgs e) in c:\
inetpub\wwwroot\aifl-na\Secure\downloadReadingAssessment2.aspx.vb:line 247
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain()
-- End of inner exception stack trace --
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain()
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecution
Step.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& comp
letedSynchronously)
The only way Ihave managed to stop this happening is to restart the IIS serv
er that connects to the database. As far as I can tell there is nothing wron
g with the SQL server, could it be a problem with the IIS server it connects
to?
Any suggestions would be greatly appreciated.
Thanks in advance,
Alistair GillespieHi:
As I knowledge, most bug is caused by the code yourself and you have the
call stack, you can see where the error happen is
quote:

> at aifl_na.downloadReadingTest2.Page_Load(Object sender, EventArgs e) in

c:\inetpub\wwwroot\aifl-na\Secure\downloadReadingAssessment2.aspx.vb:line
247
I suggest you insert a breakpoint at line 247 for
downloadReadingAssessment2.aspx.vb, please check the status at that line and
you may ask in the vb groupnews, because it is not exeception throws by sql
server, after I search in MSDN, it is not error can can handle in vs.net
Best Wishes
Wei Ci Zhou|||You might try running a network monitor trace to see what is going on on
the network when this problem occurs.
Rand
This posting is provided "as is" with no warranties and confers no rights.

General Network Error

Hi,
we have written a vb.net program using SQL Server 2000 SP4 over OLEDB.
Our customer has a network which is sometimes quite instable. So we did
some tests in our office, because we wanted to help our customer by
redisigning some of our SQL calls.
When we start the program and disconnect the network cable then the
next SQL query will result in a General Network Error, which is
logical.
When we start the program, then disconnect the network cable for about
ten seconds, then reconnect it, then the next SQL query will also
result in the same error, which we already cannot understand.
When we do the same as above, but before the next SQL query we close
the connection and reopen it, we still get the same error, which is
strange.
When we close, dispose and then recreate and open the connection, then
assign the connection to a new command and execute the SQL command, we
still get the same error.
When we stop the program and restart it, we can reconnect to the
database.
But when starting the program, we do nothing else than creating and
opening a connection. So why does it not work to reconnect while the
program is running?
Any explanations or suggestions?
Many thanks.
Daniel.Dear Daniel,
I got the same error with u , Did u solve the problem?
thanks
From Agnes
*** Sent via Developersdex http://www.codecomments.com ***|||Hi Agnes,
Unfortunately I never have got an answer to this post. I also posted
similar requests to other forums, but I never have got any answer. So
our problem still persists.
Regards.
Daniel.

General connection to SQL Server... done... grids and data retrival ...ugghhh

Help!!! please!!!... I'm pulling my hair off... Having an external hosting for sql server is terrible for .net. Too many restrictions and they are not willing to help at all... I cannot connect directly, I have to do everything using strings. Honestly and it's a shame to admit it I never learned how to connect using strings, only using the wizard (upsizing DBs from Access to SQL Server)finally, after a month of trying I was able to connect to the database using a string like this:
Dim CS As String
Dim db_name, db_username, db_userpassword As String
Dim db_server As String

db_server = "blah,blah,secureserver.net" /yes, with them >:(
db_name = "DB##"
db_username = "***"
db_userpassword = "***"


Me.SqlConnection1.ConnectionString = "SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword

I am probably not using it right but it's working to capture info using stored procedures but I've been trying to get my datagrids to connect and they are impossible... Any ideas? what would be the coding part of the datagrid/dataset/etc... connection? That probably means that I can't use the property builder or the dataset generator, right? Any ideas ? Thanks

(using 1.1 Framework)

I hope you are not doing this in every page? Tomorrow if you need to change hosting companies you dont want to go through all the pain you are now going through again, do you? You might want to put the connection string in web.config file and use the connection string all over your app. So even if you need to point the server to a different machine, its just one line you need to change and your app can remain as is.

Regarding code snippets for datagrid/dataset check out articles at 4guysfromrolla.com. They have an extensive series of articles on datagrids. Besides you can always google for specific issues.

sql

Friday, March 23, 2012

GACing components

Hi, help please!!

I'm trying to GAC a component that I've built. I had one of my company's .Net gurus help me out with this and we did a few things without me actually following what was going on. Stuff like creating a public key, creating a .snk file in C:\Program Files\Microsoft SQL Server\90\DTS\PipelineComponents...I have to confess I didn't really follow what he was doing!

But, we did manage to succssfully get my component into the SSIS toolbox which was the main thing.

Then I looked at the BOL page explaining how to install and GAC stuff (ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.SQLSVR.v9.en/dtsref9/html/efe22939-9186-4eb4-ac33-6b92f12e93db.htm) and it made no mention of the stuff we'd done. So, I tried to back that stuff out which included removing the following line from AssemblyInfo.vb:
<Assembly: AssemblyKeyFile("C:\Program Files\Microsoft SQL Server\90\DTS\PipelineComponents\RegExComponent.snk")>

And now, when ever I try to GAC the component using the same command (i.e. gacutil /iF "c:\program files\Microsoft SQL Server\90\DTS\PipelineComponents\RegExComponent.dll") I get the following error:

Failure to add assembly to the cache: Attempt to install an assembly without a strong name

Can anyone fill me in on what's going on? Why can't I GAC stuff without that reference to the snk file? What is an .snk file? Why did I need it to originally GAC stuff when the BOL page makes ne mention of it?

questions questions...

cheers
Jamie
Hi,

Any assembly that needs to be put into the GAC needs to be Strong Named.

Go through the following links to know what is a Strong Name and to create a key and then to sign your assembly using the key generated:
1.]Strong Named Assemblies
2.]Creating a Key
3.]Example and steps on Strongnaming a DLL

Regards,
Vikram|||You're correct that an assembly needs to be signed with a strong name before it can be installed in the GAC. A .NET Framework tool named sn.exe is used to generate the key file used for signing. I found a topic named "Strong-Named Assemblies" in the Framework SDK that summarizes the verification benefits of the strong name.

In Visual Studio 2003, you linked key file to code by the manual entry in assemblyinfo.vb that you mentioned. In Visual Studio 2005, you can configure Project Properties to sign your assembly with the selected key file each time that you build it. This is great for ease of use, but may allow the developer to forget that it's taking place...which may be why such an important step was overlooked in the BOL topic.

On the subject of ease of use, note that you can also use VS 2005 "post build events" scripts to uninstall the previous version of your component from the GAC, copy the new build to the PipelineComponents folder, and install the new build into the GAC.

I'll make sure that the BOL topic you mentioned is update to mention the strong name requirement.

-Doug
|||Thanks for the advice guys, that makes more sense now. If I have any more problems I'll let you know.

I'm particularly interested in the scripts that Doug mentioned for re-installing a component. I'll take a look at that later and no doubt be replying here with some Qs Smile

-Jamie|||

Set your build events to run gacutil. /if forces an install, other flags perform an uninstall. Using the macros helps, so I always have the same commands regardless of project. My post-build event is-

"$(DevEnvDir)\..\..\SDK\v2.0\Bin\gacutil" /if "$(TargetPath)"

|||Hi again,
I added a post-build-event as Darren suggested. When I built the project I got:

Rebuild All started: Project: RegEx, Configuration: Release Any CPU

Vbc.exe /noconfig /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Data,System.Diagnostics /nowarn:"42016,41999,42017,42018,42019,42032,42036,42020,42021,42022" /rootnamespace:Conchango.SqlServer.SSIS.DataFlow.RegExComponent /doc:obj\Release\Conchango.SqlServer.SSIS.DataFlow.xml /define:"CONFIG=\"Release\",TRACE=-1,_MyType=\"Windows\"" /reference:"C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.SqlServer.DTSPipelineWrap.dll","C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.SQLServer.DTSRuntimeWrap.dll","C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.SqlServer.PipelineHost.dll",C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\System.Data.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\System.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\System.Xml.dll /debug- /keyfile:RegExComponent.snk /optimize+ /out:obj\Release\Conchango.SqlServer.SSIS.DataFlow.RegExComponent.dll /resource:obj\Release\Conchango.SqlServer.SSIS.DataFlow.RegExComponent.Resources.resources /target:library RegEx.vb "My Project\AssemblyInfo.vb" "My Project\Application.Designer.vb" "My Project\Resources.Designer.vb" "My Project\Settings.Designer.vb"

RegEx -> C:\Program Files\Microsoft SQL Server\90\DTS\PipelineComponents\Conchango.SqlServer.SSIS.DataFlow.RegExComponent.dll

"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\Gacutil" /if "C:\Program Files\Microsoft SQL Server\90\DTS\PipelineComponents\Conchango.SqlServer.SSIS.DataFlow.RegExComponent.dll"

Microsoft (R) .NET Global Assembly Cache Utility. Version 2.0.50215.44

Copyright (C) Microsoft Corporation. All rights reserved.

Assembly successfully added to the cache

========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Which all looks pretty hunky dory to me. Looks as though its got to the GAC OK.

So now I want to use that component. I go into my toolbox, delete the previous incarnation from the toolbox and go into "Choose Items...". I pick the new component from the list and its back in my toolbox. When I use it, its still the old version of my component.

The only way I can get it to definately pick up the new one is to change the assembly version number. Forgive my ignorance but is this expected?
-Jamie

|||No, that is not expected. Changing the assembly version is a ball ache, as it changes the strong name, which is what the package references. Hack the Xml time to keep compatability!

Sounds like you have version mismatches in different locations. You will need to restart BIDS to get it to pick up a new build.

Double check you are -

Copying or building to the \PipelineComponents\ directory
GAC'ing the correct version.

I used to build to the PipelineComponents folder, but there are two issues with this-

1 Sometimes VS looses the plot on the build folder, and all those relative path dot dots, so I ended up with a \Program Files....PipelineComponents\ hierachy under
my project!

2 FxCop bitches if the assembly is not under the project.

So leave the build folder to the default bin\<config>.

Then use Post-Build events such as these-

"$(DevEnvDir)\..\..\SDK\v2.0\Bin\gacutil" /if "$(TargetPath)"
copy "$(TargetPath)" "$(SolutionDir)Build" /Y
copy "$(TargetPath)" "C:\Program Files\Microsoft SQL Server\90\DTS\PipelineComponents" /Y
Install to GAC
Copy to my build folder which is what I use for installs and similar
Copy to DTS folder|||

DarrenSQLIS wrote:

No, that is not expected. Changing the assembly version is a ball ache, as it changes the strong name, which is what the package references. Hack the Xml time to keep compatability!

Sounds like you have version mismatches in different locations. You will need to restart BIDS to get it to pick up a new build.

Double check you are -

Copying or building to the \PipelineComponents\ directory
GAC'ing the correct version.

I used to build to the PipelineComponents folder, but there are two issues with this-

1 Sometimes VS looses the plot on the build folder, and all those relative path dot dots, so I ended up with a \Program Files....PipelineComponents\ hierachy under
my project!

2 FxCop bitches if the assembly is not under the project.

So leave the build folder to the default bin\<config>.

Then use Post-Build events such as these-

"$(DevEnvDir)\..\..\SDK\v2.0\Bin\gacutil" /if "$(TargetPath)"
copy "$(TargetPath)" "$(SolutionDir)Build" /Y
copy "$(TargetPath)" "C:\Program Files\Microsoft SQL Server\90\DTS\PipelineComponents" /Y
Install to GAC
Copy to my build folder which is what I use for installs and similar
Copy to DTS folder

Cheers Darren. it seems as though stopping and starting BIDS (which is equally as much a ballache) would solve this. Ah well!

I haven't had the same experiences that you have - I build straight to the DTS\PipelineComponents folder and GAC it using post-build-events and had no problems...yet! If and when I do I'll switch back.

Ta
-Jamie|||

I go into my toolbox, delete the previous incarnation from the toolbox and go into "Choose Items...".

Does this mean that everytime i make changes to my assembly i have to go to each script task and 'remove & add' the reference again?

I'm hoping not.

Btw, what is BDIS and how do you restart it?

thanks.

|||

If your assembly string name changes, then yes I think you will need to remove and re-add the reference.

BIDS
(http://wiki.sqlis.com/default.aspx/SQLISWiki/BIDS.html)

|||

So if i don't change the assembly name, i just recompile my assembly and GAC it, and my package script will pick up the new code right?

Also, in a deployment scenario, do i have to copy my assembly into the c:\windows\framework\2.0\ directory before i GAC it ? I had to do this in order 'Add reference' in my script. Do i need to do this when deploying? or just GACing the assembly will do?

As for BIDS, duh! why didn't i think of it! Too many acronyms in my mind.

|||

Enzoe wrote:

So if i don't change the assembly name, i just recompile my assembly and GAC it, and my package script will pick up the new code right?

If you don't change your assembly strong name. This is made up of the assembly name, assembly version and public key token from key used to sign it. So leave the name alone, fix the version (take out the * if present in AssemblyInfo), and don't change the signing keys. The latter is not something peopl do very often.

Enzoe wrote:

Also, in a deployment scenario, do i have to copy my assembly into the c:\windows\framework\2.0\ directory before i GAC it ? I had to do this in order 'Add reference' in my script. Do i need to do this when deploying? or just GACing the assembly will do?

Correct, GAC will suffice. The framework folder is only required for the designer to be able to find it for the Add Reference. At runtime it will look in the GAC for you.

|||

That was my line of thought and i did read about this somewhere. But i just did some changes to my assembly (added a new function), built it and gac-ed it from my assembly project folder.

When i opened my package and script, the new function didn't appear. i had to copy my assembly back to the framework directory and re-GAC it before the new function appeared in my intellisense.

Or can i summarise that whenever design is required, not just at the 'add reference' point, but also for intellisense and coding to work, it has to be copied to framework directory but when the package actually executes, it looks at the GAC only.

Is this understanding accurate?

|||

Enzoe wrote:

that whenever design is required, not just at the 'add reference' point, but also for intellisense and coding to work, it has to be copied to framework directory but when the package actually executes, it looks at the GAC only.

Correct.

GACing components

Hi, help please!!

I'm trying to GAC a component that I've built. I had one of my company's .Net gurus help me out with this and we did a few things without me actually following what was going on. Stuff like creating a public key, creating a .snk file in C:\Program Files\Microsoft SQL Server\90\DTS\PipelineComponents...I have to confess I didn't really follow what he was doing!

But, we did manage to succssfully get my component into the SSIS toolbox which was the main thing.

Then I looked at the BOL page explaining how to install and GAC stuff (ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.SQLSVR.v9.en/dtsref9/html/efe22939-9186-4eb4-ac33-6b92f12e93db.htm) and it made no mention of the stuff we'd done. So, I tried to back that stuff out which included removing the following line from AssemblyInfo.vb:
<Assembly: AssemblyKeyFile("C:\Program Files\Microsoft SQL Server\90\DTS\PipelineComponents\RegExComponent.snk")>

And now, when ever I try to GAC the component using the same command (i.e. gacutil /iF "c:\program files\Microsoft SQL Server\90\DTS\PipelineComponents\RegExComponent.dll") I get the following error:

Failure to add assembly to the cache: Attempt to install an assembly without a strong name

Can anyone fill me in on what's going on? Why can't I GAC stuff without that reference to the snk file? What is an .snk file? Why did I need it to originally GAC stuff when the BOL page makes ne mention of it?

questions questions...

cheers
Jamie
Hi,

Any assembly that needs to be put into the GAC needs to be Strong Named.

Go through the following links to know what is a Strong Name and to create a key and then to sign your assembly using the key generated:
1.]Strong Named Assemblies
2.]Creating a Key
3.]Example and steps on Strongnaming a DLL

Regards,
Vikram|||You're correct that an assembly needs to be signed with a strong name before it can be installed in the GAC. A .NET Framework tool named sn.exe is used to generate the key file used for signing. I found a topic named "Strong-Named Assemblies" in the Framework SDK that summarizes the verification benefits of the strong name.

In Visual Studio 2003, you linked key file to code by the manual entry in assemblyinfo.vb that you mentioned. In Visual Studio 2005, you can configure Project Properties to sign your assembly with the selected key file each time that you build it. This is great for ease of use, but may allow the developer to forget that it's taking place...which may be why such an important step was overlooked in the BOL topic.

On the subject of ease of use, note that you can also use VS 2005 "post build events" scripts to uninstall the previous version of your component from the GAC, copy the new build to the PipelineComponents folder, and install the new build into the GAC.

I'll make sure that the BOL topic you mentioned is update to mention the strong name requirement.

-Doug|||Thanks for the advice guys, that makes more sense now. If I have any more problems I'll let you know.

I'm particularly interested in the scripts that Doug mentioned for re-installing a component. I'll take a look at that later and no doubt be replying here with some Qs Smile

-Jamie|||

Set your build events to run gacutil. /if forces an install, other flags perform an uninstall. Using the macros helps, so I always have the same commands regardless of project. My post-build event is-

"$(DevEnvDir)\..\..\SDK\v2.0\Bin\gacutil" /if "$(TargetPath)"

|||Hi again,
I added a post-build-event as Darren suggested. When I built the project I got:

Rebuild All started: Project: RegEx, Configuration: Release Any CPU

Vbc.exe /noconfig /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Data,System.Diagnostics /nowarn:"42016,41999,42017,42018,42019,42032,42036,42020,42021,42022" /rootnamespace:Conchango.SqlServer.SSIS.DataFlow.RegExComponent /doc:obj\Release\Conchango.SqlServer.SSIS.DataFlow.xml /define:"CONFIG=\"Release\",TRACE=-1,_MyType=\"Windows\"" /reference:"C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.SqlServer.DTSPipelineWrap.dll","C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.SQLServer.DTSRuntimeWrap.dll","C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.SqlServer.PipelineHost.dll",C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\System.Data.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\System.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\System.Xml.dll /debug- /keyfile:RegExComponent.snk /optimize+ /out:obj\Release\Conchango.SqlServer.SSIS.DataFlow.RegExComponent.dll /resource:obj\Release\Conchango.SqlServer.SSIS.DataFlow.RegExComponent.Resources.resources /target:library RegEx.vb "My Project\AssemblyInfo.vb" "My Project\Application.Designer.vb" "My Project\Resources.Designer.vb" "My Project\Settings.Designer.vb"

RegEx -> C:\Program Files\Microsoft SQL Server\90\DTS\PipelineComponents\Conchango.SqlServer.SSIS.DataFlow.RegExComponent.dll

"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\Gacutil" /if "C:\Program Files\Microsoft SQL Server\90\DTS\PipelineComponents\Conchango.SqlServer.SSIS.DataFlow.RegExComponent.dll"

Microsoft (R) .NET Global Assembly Cache Utility. Version 2.0.50215.44

Copyright (C) Microsoft Corporation. All rights reserved.

Assembly successfully added to the cache

========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Which all looks pretty hunky dory to me. Looks as though its got to the GAC OK.

So now I want to use that component. I go into my toolbox, delete the previous incarnation from the toolbox and go into "Choose Items...". I pick the new component from the list and its back in my toolbox. When I use it, its still the old version of my component.

The only way I can get it to definately pick up the new one is to change the assembly version number. Forgive my ignorance but is this expected?
-Jamie

|||No, that is not expected. Changing the assembly version is a ball ache, as it changes the strong name, which is what the package references. Hack the Xml time to keep compatability!

Sounds like you have version mismatches in different locations. You will need to restart BIDS to get it to pick up a new build.

Double check you are -

Copying or building to the \PipelineComponents\ directory
GAC'ing the correct version.

I used to build to the PipelineComponents folder, but there are two issues with this-

1 Sometimes VS looses the plot on the build folder, and all those relative path dot dots, so I ended up with a \Program Files....PipelineComponents\ hierachy under
my project!

2 FxCop bitches if the assembly is not under the project.

So leave the build folder to the default bin\<config>.

Then use Post-Build events such as these-

"$(DevEnvDir)\..\..\SDK\v2.0\Bin\gacutil" /if "$(TargetPath)"
copy "$(TargetPath)" "$(SolutionDir)Build" /Y
copy "$(TargetPath)" "C:\Program Files\Microsoft SQL Server\90\DTS\PipelineComponents" /Y
Install to GAC
Copy to my build folder which is what I use for installs and similar
Copy to DTS folder

|||

DarrenSQLIS wrote:

No, that is not expected. Changing the assembly version is a ball ache, as it changes the strong name, which is what the package references. Hack the Xml time to keep compatability!

Sounds like you have version mismatches in different locations. You will need to restart BIDS to get it to pick up a new build.

Double check you are -

Copying or building to the \PipelineComponents\ directory
GAC'ing the correct version.

I used to build to the PipelineComponents folder, but there are two issues with this-

1 Sometimes VS looses the plot on the build folder, and all those relative path dot dots, so I ended up with a \Program Files....PipelineComponents\ hierachy under
my project!

2 FxCop bitches if the assembly is not under the project.

So leave the build folder to the default bin\<config>.

Then use Post-Build events such as these-

"$(DevEnvDir)\..\..\SDK\v2.0\Bin\gacutil" /if "$(TargetPath)"
copy "$(TargetPath)" "$(SolutionDir)Build" /Y
copy "$(TargetPath)" "C:\Program Files\Microsoft SQL Server\90\DTS\PipelineComponents" /Y
Install to GAC
Copy to my build folder which is what I use for installs and similar
Copy to DTS folder

Cheers Darren. it seems as though stopping and starting BIDS (which is equally as much a ballache) would solve this. Ah well!

I haven't had the same experiences that you have - I build straight to the DTS\PipelineComponents folder and GAC it using post-build-events and had no problems...yet! If and when I do I'll switch back.

Ta
-Jamie|||

I go into my toolbox, delete the previous incarnation from the toolbox and go into "Choose Items...".

Does this mean that everytime i make changes to my assembly i have to go to each script task and 'remove & add' the reference again?

I'm hoping not.

Btw, what is BDIS and how do you restart it?

thanks.

|||

If your assembly string name changes, then yes I think you will need to remove and re-add the reference.

BIDS
(http://wiki.sqlis.com/default.aspx/SQLISWiki/BIDS.html)

|||

So if i don't change the assembly name, i just recompile my assembly and GAC it, and my package script will pick up the new code right?

Also, in a deployment scenario, do i have to copy my assembly into the c:\windows\framework\2.0\ directory before i GAC it ? I had to do this in order 'Add reference' in my script. Do i need to do this when deploying? or just GACing the assembly will do?

As for BIDS, duh! why didn't i think of it! Too many acronyms in my mind.

|||

Enzoe wrote:

So if i don't change the assembly name, i just recompile my assembly and GAC it, and my package script will pick up the new code right?

If you don't change your assembly strong name. This is made up of the assembly name, assembly version and public key token from key used to sign it. So leave the name alone, fix the version (take out the * if present in AssemblyInfo), and don't change the signing keys. The latter is not something peopl do very often.

Enzoe wrote:

Also, in a deployment scenario, do i have to copy my assembly into the c:\windows\framework\2.0\ directory before i GAC it ? I had to do this in order 'Add reference' in my script. Do i need to do this when deploying? or just GACing the assembly will do?

Correct, GAC will suffice. The framework folder is only required for the designer to be able to find it for the Add Reference. At runtime it will look in the GAC for you.

|||

That was my line of thought and i did read about this somewhere. But i just did some changes to my assembly (added a new function), built it and gac-ed it from my assembly project folder.

When i opened my package and script, the new function didn't appear. i had to copy my assembly back to the framework directory and re-GAC it before the new function appeared in my intellisense.

Or can i summarise that whenever design is required, not just at the 'add reference' point, but also for intellisense and coding to work, it has to be copied to framework directory but when the package actually executes, it looks at the GAC only.

Is this understanding accurate?

|||

Enzoe wrote:

that whenever design is required, not just at the 'add reference' point, but also for intellisense and coding to work, it has to be copied to framework directory but when the package actually executes, it looks at the GAC only.

Correct.

GAC issue

I have .NET 1.1/Visual Studio 2003 and am trying to make the .NET C# code visible in SSIS -- I am a newcomer to GAC and did the following:

Set up a strong-name key pair

Put in the reference to it inside assemblyinfo

Put in PreBuild event to uninstall in GAC and PostBuild to install in GAC

All appeared fine

Set up project in SSIS

Put up Add Reference dialog and looked for project dll -- not there

I see from above something about putting the assembly into c:\windows\framework\... I do not have

a directory "framework" under "windows"

Is there another place I should put the assembly>

It references when I put the assembly in the V 2.0 dir, that is,

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

Note: this is a version 1.1 assembly. Would there be any

problems with just going ahead and doing this?

|||GAC is a runtime thing. Putting the assembly in the appropriate .NET folder allows you to reference it for debugging and intellisense.sql

Monday, March 19, 2012

Fundamental help required with SQL connection

I am writing SQL data apps using VB.NET 2003, MSDE is being used as the
server.

When I create and instance of the server, it has a the format
machinename/instancename

This is fine for the developement machine but how does my code connect to
the server when it is on another machine ? When an instance of MSDE is run
on the target, it will produce...
anotherPCname/instancename

Thanks for any helpThe 'Data Source' keyword in the connection string specifies the SQL Server
instance you want to connect to. A best practice is to store the connection
string externally (e.g. config file) rather than hard-code it in your app so
that you can connect to different servers without changing code. Connection
string examples:

Local default instance:
Data Source=ThisServer;Initial Catalog=MyDatabase;Integrated Security=SSPI

Local named instance:
Data Source=ThisServer\ThisInstance;Initial Catalog=MyDatabase;Integrated
Security=SSPI

Remote default instance:
Data Source=OtherServer;Initial Catalog=MyDatabase;Integrated Security=SSPI

Remote named instance:
Data Source=OtherServer\OtherInstance;Initial Catalog=MyDatabase;Integrated
Security=SSPI

--
Hope this helps.

Dan Guzman
SQL Server MVP

"David" <david@.orbitcoms.com> wrote in message
news:YNvEc.71214$sj4.25491@.news-server.bigpond.net.au...
> I am writing SQL data apps using VB.NET 2003, MSDE is being used as the
> server.
> When I create and instance of the server, it has a the format
> machinename/instancename
> This is fine for the developement machine but how does my code connect to
> the server when it is on another machine ? When an instance of MSDE is run
> on the target, it will produce...
> anotherPCname/instancename
> Thanks for any help
>|||Dan,

Thanks for the reply.

So, I just need to create a text file with the connection string with say

the local machine ID and database name. The application loads this at boot

and

connects to the named server.

When I deploy the application, I have the client alter the text file by

finding

the machine name and modifying the text to suit ??

I suppose I could use a Try Catch and have try with the local settings and

if it fails

it loads the file in the catch sub (or maybe the string is stored in

registry).

One thing I am also unable to find out is. How does MSDE know where the file

is located on the third party machine ? Should the Initial Catalog =

Path+dasename ?

Thanks

"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:FayEc.70$oD3.17@.newsread1.news.pas.earthlink. net...
> The 'Data Source' keyword in the connection string specifies the SQL
Server
> instance you want to connect to. A best practice is to store the
connection
> string externally (e.g. config file) rather than hard-code it in your app
so
> that you can connect to different servers without changing code.
Connection
> string examples:
> Local default instance:
> Data Source=ThisServer;Initial Catalog=MyDatabase;Integrated Security=SSPI
> Local named instance:
> Data Source=ThisServer\ThisInstance;Initial Catalog=MyDatabase;Integrated
> Security=SSPI
> Remote default instance:
> Data Source=OtherServer;Initial Catalog=MyDatabase;Integrated
Security=SSPI
> Remote named instance:
> Data Source=OtherServer\OtherInstance;Initial
Catalog=MyDatabase;Integrated
> Security=SSPI
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "David" <david@.orbitcoms.com> wrote in message
> news:YNvEc.71214$sj4.25491@.news-server.bigpond.net.au...
> > I am writing SQL data apps using VB.NET 2003, MSDE is being used as the
> > server.
> > When I create and instance of the server, it has a the format
> > machinename/instancename
> > This is fine for the developement machine but how does my code connect
to
> > the server when it is on another machine ? When an instance of MSDE is
run
> > on the target, it will produce...
> > anotherPCname/instancename
> > Thanks for any help|||Hi

To connect to a different instance/server that is running your database then
the connection string will need to be changed. Quite often this sort of
thing is held in the registry and you configure it on installation.
Alternatively you may want to provide a small application to configure the
settings.

http://www.microsoft.com/sql/msde/t...integration.asp

John

"David" <david@.orbitcoms.com> wrote in message
news:YNvEc.71214$sj4.25491@.news-server.bigpond.net.au...
> I am writing SQL data apps using VB.NET 2003, MSDE is being used as the
> server.
> When I create and instance of the server, it has a the format
> machinename/instancename
> This is fine for the developement machine but how does my code connect to
> the server when it is on another machine ? When an instance of MSDE is run
> on the target, it will produce...
> anotherPCname/instancename
> Thanks for any help
>|||Thanks again for the replies.

I have tried a hard-coded option of connection and it worked.

ie.

TRY
sqlconnectionstring = ...... originalmachinename......password=..."
CATCH
sqlconnectionstring = ...... newmachinename......password=..."
END TRY

I tried to hook this into a config file but I had trouble(I used the wizard
in VB.NET to make the connection string and edited it but the area the code
was placed did not seem to like me playing with the code adding file open
command etc.

I will try by completely coding the connection in the main form load
routine.
Like this

TRY
Load my original instance for development and test
CATCH
read registry and see if validconnect string exists
if so then try to connect else
prompt user for PC name
save name to registry
try to connect
FINALLY
give up
END TRY

would this approach seem reasonable ?

"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:_FyEc.6675$%N6.73110644@.news-text.cableinet.net...
> Hi
> To connect to a different instance/server that is running your database
then
> the connection string will need to be changed. Quite often this sort of
> thing is held in the registry and you configure it on installation.
> Alternatively you may want to provide a small application to configure the
> settings.
> http://www.microsoft.com/sql/msde/t...integration.asp
> John
> "David" <david@.orbitcoms.com> wrote in message
> news:YNvEc.71214$sj4.25491@.news-server.bigpond.net.au...
> > I am writing SQL data apps using VB.NET 2003, MSDE is being used as the
> > server.
> > When I create and instance of the server, it has a the format
> > machinename/instancename
> > This is fine for the developement machine but how does my code connect
to
> > the server when it is on another machine ? When an instance of MSDE is
run
> > on the target, it will produce...
> > anotherPCname/instancename
> > Thanks for any help|||Hi

This may help:
http://support.microsoft.com/defaul...kb;en-us;309485
http://support.microsoft.com/defaul...kb;EN-US;283245

John

"David" <david@.orbitcoms.com> wrote in message
news:qazEc.71562$sj4.10264@.news-server.bigpond.net.au...
> Thanks again for the replies.
> I have tried a hard-coded option of connection and it worked.
> ie.
> TRY
> sqlconnectionstring = ......
originalmachinename......password=..."
> CATCH
> sqlconnectionstring = ...... newmachinename......password=..."
> END TRY
> I tried to hook this into a config file but I had trouble(I used the
wizard
> in VB.NET to make the connection string and edited it but the area the
code
> was placed did not seem to like me playing with the code adding file open
> command etc.
> I will try by completely coding the connection in the main form load
> routine.
> Like this
> TRY
> Load my original instance for development and test
> CATCH
> read registry and see if validconnect string exists
> if so then try to connect else
> prompt user for PC name
> save name to registry
> try to connect
> FINALLY
> give up
> END TRY
> would this approach seem reasonable ?
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:_FyEc.6675$%N6.73110644@.news-text.cableinet.net...
> > Hi
> > To connect to a different instance/server that is running your database
> then
> > the connection string will need to be changed. Quite often this sort of
> > thing is held in the registry and you configure it on installation.
> > Alternatively you may want to provide a small application to configure
the
> > settings.
> > http://www.microsoft.com/sql/msde/t...integration.asp
> > John
> > "David" <david@.orbitcoms.com> wrote in message
> > news:YNvEc.71214$sj4.25491@.news-server.bigpond.net.au...
> > > I am writing SQL data apps using VB.NET 2003, MSDE is being used as
the
> > > server.
> > > > When I create and instance of the server, it has a the format
> > > machinename/instancename
> > > > This is fine for the developement machine but how does my code connect
> to
> > > the server when it is on another machine ? When an instance of MSDE is
> run
> > > on the target, it will produce...
> > > anotherPCname/instancename
> > > > Thanks for any help
> > > >|||I finally have the problem figured out. I needed to ATTACH the database to
sql server (MSDE2000) using the osql utility.

Now, would someone be able to explain how I can automate the attachment at
the customer end.
Preferably, I would like my VN.NET application install to copy the
unattached database files and attach them to the MSDE server.

Thanks

"David" <david@.orbitcoms.com> wrote in message
news:YNvEc.71214$sj4.25491@.news-server.bigpond.net.au...
> I am writing SQL data apps using VB.NET 2003, MSDE is being used as the
> server.
> When I create and instance of the server, it has a the format
> machinename/instancename
> This is fine for the developement machine but how does my code connect to
> the server when it is on another machine ? When an instance of MSDE is run
> on the target, it will produce...
> anotherPCname/instancename
> Thanks for any help
>|||Hi
I am totally new to the VB.net, only learn this about two weeks. I
used codes from MS to create a file upload class then add function to
store the uploaded filename to a table in SQL server. However I kept
getting the error message about "cannot connect to database" No matter
what format I used. I have tried at least two dozen connection stringe
formats either in Sqlconnection or OleDBConnection. Here is the basic
formats that I used:
strCon = "Data Source =localhost;Password=;User ID=sa;Initial
Catalog=Northwind" for SqlConnection
strCon = "Provider=SQLOLEDB.1;User ID=sa;Password=;Persist Security
Info=True;Initial Catalog=Northwind;Data Source=FAL-L6388" for
OleDbConnection.
I use SQL 7, which was installed by default, i,e only have user ID =
sa, no password, use the default Northwind database. That's all. My
Server is local named FAL-L688.
I have replaced the Data Source with Server= but still give me same
error. I even used an udl to create the OleDB coonnection and put
into my string, still NO. I have exhauseted all alternatives. Does
anyone have clue? Is anyway to debug the trasaction? so i can find out
what went wrong?|||Here is my codes:
Imports System.Data.OleDb
Imports System.Configuration
...
Dim oCon As New OleDbConnection
Dim oCmd As New OleDbCommand
oCon = New OleDbConnection(ConfigurationSettings.AppSettings( "strCon"))
oCon.Open()

oCmd.CommandType = CommandType.StoredProcedure
oCmd.CommandText = "set_order_attachments"
oCmd.Parameters.Add("@.cart_id", OleDbType.VarChar, 15, cart_id)
oCmd.Parameters.Add("@.attachment", OleDbType.VarChar, 255,
strFilenamesCollection)
oCmd.Connection = oCon
Try
oCon.Open()
oCmd.ExecuteNonQuery()
...
And I have fololowing setting in the Web.config file under the
<configuration>
<appSettings>
<add key="strCon"
value="Provider=SQLOLEDB.1;User ID=sa;Password=;Initial
Catalog=Northwind;Server=(local);" />
</appSettings>
Also tried to use "Data Source=.." and enter my local machine name
there.
None of them work , came back the same "Non DB connection"

C Chang|||There was a duplicated "oCon.Open()" in my codes, but removal it does
not help. However, I tried to use the OracleCommand with the SQL query
script directly and IT WORKS!. Does anyone know why it does not work
with the Oracle procedure. I hate to change all my procedure calls to
in-line scripts. Besides if there is a complicated procedure then the
query becomes a problem.|||(chi-soon_x_chang@.raytheon.com) writes:
> There was a duplicated "oCon.Open()" in my codes, but removal it does
> not help. However, I tried to use the OracleCommand with the SQL query
> script directly and IT WORKS!. Does anyone know why it does not work
> with the Oracle procedure. I hate to change all my procedure calls to
> in-line scripts. Besides if there is a complicated procedure then the
> query becomes a problem.

I'm getting confused, are you connecting to SQL Server or to Oracle?

To go back to your original code, the error message seems like it
would from your own code. That is, I cannot really recall any error
that says "Cannot connect to database". It would help, if you could
get hold of the actual message from the client library. To that end,
it would help if you posted more parts of the code, and also if you
found out on exactly which statement, things go wrong.

Stupid check: you have SQL Server running, haven't you?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Hi

In addition to Erlands comments, you may want to move the try block earlier
to catch the connection error. Also check out
http://www.connectionstrings.com/ for the connection string, I think you
should be using Data Source instead of Server. Try using the IP address
instead of the name if necessary.

John

<chi-soon_x_chang@.raytheon.com> wrote in message
news:1103838243.185277.162240@.z14g2000cwz.googlegr oups.com...
> There was a duplicated "oCon.Open()" in my codes, but removal it does
> not help. However, I tried to use the OracleCommand with the SQL query
> script directly and IT WORKS!. Does anyone know why it does not work
> with the Oracle procedure. I hate to change all my procedure calls to
> in-line scripts. Besides if there is a complicated procedure then the
> query becomes a problem.

Friday, February 24, 2012

Full-Text Search Not Finding Suffix

Hello,
This is my first post to MS tech net. I started using SQL Server 2005 and
Visual Studio 2005 YESTERDAY so I am very new to this.
I am implementing a site search and want to use Full-Text search. I have a
small test table with a few columns (all enabled for FTS and I have populated
the catalog).
The problem is when I type in 'word' I do not get 'words' back from the
database, only 'word'. If I type in 'computer' I only get 'computer' and not
'computers' and 'computerized'. If I type in 'computer computers' then I get
both.
I was under the impression that FTS supports prefix searches and even verb
and noun variations. Please someone help me figure out the problem.
I am using: SQL Server 2005, Windows XP Pro, Visual Studio 2005.
My Query:
strSearch = "SELECT icgMenuSectionName FROM icgMenu WHERE FREETEXT(
icgMenuSectionName, @.searchphrase)";
Thank You!
Karina
The problem is probably that you are either using the neutral word breaker,
or you are inadvertently wrapping your search phrase in double quotes which
disables the stemming - stemming is the function which allows you to search
on all generations or a word, i.e. plural, singular, declensions, or
conjugations of a word.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
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
"Karina" <Karina@.discussions.microsoft.com> wrote in message
news:A25E30E6-0673-4278-B3F4-BEDBB056F7C6@.microsoft.com...
> Hello,
> This is my first post to MS tech net. I started using SQL Server 2005 and
> Visual Studio 2005 YESTERDAY so I am very new to this.
> I am implementing a site search and want to use Full-Text search. I have
> a
> small test table with a few columns (all enabled for FTS and I have
> populated
> the catalog).
> The problem is when I type in 'word' I do not get 'words' back from the
> database, only 'word'. If I type in 'computer' I only get 'computer' and
> not
> 'computers' and 'computerized'. If I type in 'computer computers' then I
> get
> both.
> I was under the impression that FTS supports prefix searches and even verb
> and noun variations. Please someone help me figure out the problem.
> I am using: SQL Server 2005, Windows XP Pro, Visual Studio 2005.
> My Query:
> strSearch = "SELECT icgMenuSectionName FROM icgMenu WHERE FREETEXT(
> icgMenuSectionName, @.searchphrase)";
> Thank You!
> Karina
>
>
>
|||Hilary, thank you for the response. I've read almost every posting you had
in these groups
I did had Neutral set (I set it to English). I don't have double quotes in
the query (I don't think).
This is what I have:
void Button_Click( object s, EventArgs e ) {
SqlConnection conPubs;
string strSearch;
SqlCommand cmdSearch;
SqlDataReader dtrSearch;
conPubs = new
SqlConnection(@."Server=localhost;uid=sa;pwd=stuff; Database=icg" );
strSearch = "SELECT icgMenuSectionName FROM icgMenu WHERE contains(
icgMenuSectionName, @.searchphrase )";
cmdSearch = new SqlCommand( strSearch, conPubs );
cmdSearch.Parameters.Add("@.searchphrase", txtSearchPhrase.Text);
Response.Write(strSearch);
conPubs.Open();
dtrSearch = cmdSearch.ExecuteReader();
while ( dtrSearch.Read())
{
lblResults.Text += "<li>" + dtrSearch[ "icgMenuSectionName" ];
}
conPubs.Close();
}
I've read every post in this newsgroup and tried everything. Any help is
greatly appreciated, I've been at this since Monday night.
Thanks again!
"Hilary Cotter" wrote:

> The problem is probably that you are either using the neutral word breaker,
> or you are inadvertently wrapping your search phrase in double quotes which
> disables the stemming - stemming is the function which allows you to search
> on all generations or a word, i.e. plural, singular, declensions, or
> conjugations of a word.
> --
> Hilary Cotter
> Director of Text Mining and Database Strategy
> RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
> This posting is my own and doesn't necessarily represent RelevantNoise's
> positions, strategies or opinions.
> 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
>
> "Karina" <Karina@.discussions.microsoft.com> wrote in message
> news:A25E30E6-0673-4278-B3F4-BEDBB056F7C6@.microsoft.com...
>
>
|||Hello,
I'm still searching for help with this issue. It appears that my query
appends double quotes so that it disables the suffix search in FTS service.
How do I make it NOT have the double quotes. When I try to get rid of them,
VS2005 complains, I tried all combinations of quotes with no success. Please
help, I've been stumped all week.
My code:
void Button_Click( object s, EventArgs e ) {
> SqlConnection conPubs;
> string strSearch;
> SqlCommand cmdSearch;
> SqlDataReader dtrSearch;
> conPubs = new
> SqlConnection(@."Server=localhost;uid=sa;pwd=stuff; Database=icg" );
> strSearch = "SELECT icgMenuSectionName FROM icgMenu WHERE contains(
> icgMenuSectionName, @.searchphrase )";
> cmdSearch = new SqlCommand( strSearch, conPubs );
> cmdSearch.Parameters.Add("@.searchphrase", txtSearchPhrase.Text);
> Response.Write(strSearch);
> conPubs.Open();
> dtrSearch = cmdSearch.ExecuteReader();
>
> while ( dtrSearch.Read())
> {
> lblResults.Text += "<li>" + dtrSearch[ "icgMenuSectionName" ];
> }
>
> conPubs.Close();
> }
"Karina" wrote:
[vbcol=seagreen]
> Hilary, thank you for the response. I've read almost every posting you had
> in these groups
> I did had Neutral set (I set it to English). I don't have double quotes in
> the query (I don't think).
> This is what I have:
>
> I've read every post in this newsgroup and tried everything. Any help is
> greatly appreciated, I've been at this since Monday night.
> Thanks again!
> "Hilary Cotter" wrote:

Full-text search engine on SQL Server 2000

I have tried install Microsoft full-text search engine on SQL Server
2000 (Developer version). The operating system is XP Pro SP2,
with .net framework 2.0. With every variation I have tried to install
it I get:
"Installation of Microsoft Full-Text Search Engine Package Failed
(-2147220991) 0x80040201. An event was unable to invoke any of the
subscribers."
Any ideas?
Is this relevant?
http://www.kbalertz.com/Feedback_926997.aspx
"Denzyl" <daryl@.partridgesoftwaresolutions.com> wrote in message
news:1178736692.825863.109950@.n59g2000hsh.googlegr oups.com...
>I have tried install Microsoft full-text search engine on SQL Server
> 2000 (Developer version). The operating system is XP Pro SP2,
> with .net framework 2.0. With every variation I have tried to install
> it I get:
> "Installation of Microsoft Full-Text Search Engine Package Failed
> (-2147220991) 0x80040201. An event was unable to invoke any of the
> subscribers."
> Any ideas?
>
|||On 9 May, 20:42, "Hilary Cotter" <hilary.cot...@.gmail.com> wrote:
> Is this relevant?
> http://www.kbalertz.com/Feedback_926997.aspx
> "Denzyl" <d...@.partridgesoftwaresolutions.com> wrote in message
> news:1178736692.825863.109950@.n59g2000hsh.googlegr oups.com...
>
>
>
> - Show quoted text -
Thanks Hilary. Looked into this and appears that the original error
occurs whether .net framework 2 is installed or not.

FULLTEXT SEARCH any drawbacks?

I need to know are there any disadvantages of using Full Text Search with MS SQL 2000. I'm planning to host my website to be developed in asp.net with shared hosting company. Taking this into consideration can there be any problems regarding Full Text Search.

Cheers
Luckyhi there,

there are none i suppose.. all i know is that full text search speeds up data retrieval process.. take a look at the link attached.. take care..

http://www.developer.com/db/article.php/3446891|||Thanks sashi
But I read it somewhere that it puts a lot of extra load on the server. Thats why most of the hosting companies do not provide this service.

Thanks again