Showing posts with label creating. Show all posts
Showing posts with label creating. Show all posts

Tuesday, 20 March 2012

Connect to a remote database using QA or EM *WITHOUT* ever creating CNU aliases first? (MS

Accessing a hosting company's MS SQL 2000 server.
I don't have any problems connecting to a remote database with Query
Analyzer (QA) or Enterprise Manager (EM)... as
long as I first create "aliases" using the "client network utility" (CNU).
How would I connect to a remote database using QA or EM *WITHOUT* ever
creating any CNU aliases first?
QA and EM never seem to have a place to enter in the remote SQL machine's IP
address, port number, user name, password, database, etc.
(All the stuff that is needed to connect... that CNU allows me to enter.)
Thanks.
In the server name drop down for connecting with Query
Analyzer, you can type the IP address followed by a comma
and then the listening port. If you select SQL Server
Authentication, you can type a User and Password.
-Sue
On Tue, 27 Mar 2007 00:26:59 -0400, "\"A_Michigan_User\""
<Michigan_RE_M0VE@.ameritech.net> wrote:

>Accessing a hosting company's MS SQL 2000 server.
>I don't have any problems connecting to a remote database with Query
>Analyzer (QA) or Enterprise Manager (EM)... as
>long as I first create "aliases" using the "client network utility" (CNU).
>How would I connect to a remote database using QA or EM *WITHOUT* ever
>creating any CNU aliases first?
>QA and EM never seem to have a place to enter in the remote SQL machine's IP
>address, port number, user name, password, database, etc.
>(All the stuff that is needed to connect... that CNU allows me to enter.)
>Thanks.
>
|||Wow... thanks.
I was thinking that is a drop-down list-box... and that I could NOT type
directly into it... but I can.
I got things working with QA... now I'll have to try EM also.
Thanks again.
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:rm0i039em6h6gtm73mh6qeqij54qpncb52@.4ax.com...
> In the server name drop down for connecting with Query
> Analyzer, you can type the IP address followed by a comma
> and then the listening port. If you select SQL Server
> Authentication, you can type a User and Password.
> -Sue
> On Tue, 27 Mar 2007 00:26:59 -0400, "\"A_Michigan_User\""
> <Michigan_RE_M0VE@.ameritech.net> wrote:
>

Sunday, 11 March 2012

connect from webservice

I have a webservice I am creating. I am needing to connect to a SQL server on
a different machine using SQL authetication. I have the connection string
located in the machine.config. Could somebody give me a sample of how to use
that connection string to connect to the database from inside a webservice.
It's not any different than connecting from an ASP.NET page so if you know
how to do that, you should be all set. It's not a good practice to place
passwords in a config file so you should look into using Windows
authentication or at the very least encrypt the password in the config file.
Roman
Roman Rehak
http://sqlblog.com/blogs/roman_rehak
"wendld" <GenieLifts@.news.postalias> wrote in message
news:7A009E7B-EE22-4FFC-8B4B-FE870659D985@.microsoft.com...
>I have a webservice I am creating. I am needing to connect to a SQL server
>on
> a different machine using SQL authetication. I have the connection string
> located in the machine.config. Could somebody give me a sample of how to
> use
> that connection string to connect to the database from inside a
> webservice.
|||This is my first attempt at pulling in the connection string from the
machine.config. Windows Authentication is not an option since the database
and webservers are on different domains and a DMZ is in use. I currently have
the SSL encryption on, but have not encrypted the actually value in the
config file (yet). That is the next step after I get the programs working
this way.
"Roman Rehak" wrote:

> It's not any different than connecting from an ASP.NET page so if you know
> how to do that, you should be all set. It's not a good practice to place
> passwords in a config file so you should look into using Windows
> authentication or at the very least encrypt the password in the config file.
> Roman
> --
> Roman Rehak
> http://sqlblog.com/blogs/roman_rehak
>
> "wendld" <GenieLifts@.news.postalias> wrote in message
> news:7A009E7B-EE22-4FFC-8B4B-FE870659D985@.microsoft.com...
>
>
|||in web.config:
<appSettings>
<add key="ConnectionString" value="Data Source=MyServer;Initial
Catalog=AdventureWorks;User Id=MyUser;Password=MyPassword;"/>
</appSettings>
in the web service:
string cnString =
ConfigurationManager.AppSettings.Get("ConnectionSt ring");
Roman
Roman Rehak
http://sqlblog.com/blogs/roman_rehak
"wendld" <GenieLifts@.news.postalias> wrote in message
news:D1B8082F-16ED-47B7-9FD8-C5A1EBF26DED@.microsoft.com...[vbcol=seagreen]
> This is my first attempt at pulling in the connection string from the
> machine.config. Windows Authentication is not an option since the database
> and webservers are on different domains and a DMZ is in use. I currently
> have
> the SSL encryption on, but have not encrypted the actually value in the
> config file (yet). That is the next step after I get the programs working
> this way.
> "Roman Rehak" wrote:
|||I am not using the appSettings section of the web.config. I was planning on
using the connectionstrings section of the machine.config. There will be many
applications using the same connection string and I feel it would be
appropiate to put there, I just don't know how to get to this section.
"Roman Rehak" wrote:

> in web.config:
> <appSettings>
> <add key="ConnectionString" value="Data Source=MyServer;Initial
> Catalog=AdventureWorks;User Id=MyUser;Password=MyPassword;"/>
> </appSettings>
> in the web service:
> string cnString =
> ConfigurationManager.AppSettings.Get("ConnectionSt ring");
> Roman
> --
> Roman Rehak
> http://sqlblog.com/blogs/roman_rehak
>
> "wendld" <GenieLifts@.news.postalias> wrote in message
> news:D1B8082F-16ED-47B7-9FD8-C5A1EBF26DED@.microsoft.com...
>
>
|||The code is the same whether you want to read from machine.config or
web.config. If you have the same value in both, web.config takes precedence.
Here is how you get a connection string from the connectionStrings section:
cnString =
ConfigurationManager.ConnectionStrings["Connection StringAW"].ConnectionString;
Roman
Roman Rehak
http://sqlblog.com/blogs/roman_rehak
"wendld" <GenieLifts@.news.postalias> wrote in message
news:F14C7CAD-93C8-4EA4-8358-9FC2B2E8E681@.microsoft.com...[vbcol=seagreen]
>I am not using the appSettings section of the web.config. I was planning on
> using the connectionstrings section of the machine.config. There will be
> many
> applications using the same connection string and I feel it would be
> appropiate to put there, I just don't know how to get to this section.
> "Roman Rehak" wrote:

connect from webservice

I have a webservice I am creating. I am needing to connect to a SQL server o
n
a different machine using SQL authetication. I have the connection string
located in the machine.config. Could somebody give me a sample of how to use
that connection string to connect to the database from inside a webservice.It's not any different than connecting from an ASP.NET page so if you know
how to do that, you should be all set. It's not a good practice to place
passwords in a config file so you should look into using Windows
authentication or at the very least encrypt the password in the config file.
Roman
Roman Rehak
http://sqlblog.com/blogs/roman_rehak
"wendld" <GenieLifts@.news.postalias> wrote in message
news:7A009E7B-EE22-4FFC-8B4B-FE870659D985@.microsoft.com...
>I have a webservice I am creating. I am needing to connect to a SQL server
>on
> a different machine using SQL authetication. I have the connection string
> located in the machine.config. Could somebody give me a sample of how to
> use
> that connection string to connect to the database from inside a
> webservice.|||This is my first attempt at pulling in the connection string from the
machine.config. Windows Authentication is not an option since the database
and webservers are on different domains and a DMZ is in use. I currently hav
e
the SSL encryption on, but have not encrypted the actually value in the
config file (yet). That is the next step after I get the programs working
this way.
"Roman Rehak" wrote:

> It's not any different than connecting from an ASP.NET page so if you know
> how to do that, you should be all set. It's not a good practice to place
> passwords in a config file so you should look into using Windows
> authentication or at the very least encrypt the password in the config fil
e.
> Roman
> --
> Roman Rehak
> http://sqlblog.com/blogs/roman_rehak
>
> "wendld" <GenieLifts@.news.postalias> wrote in message
> news:7A009E7B-EE22-4FFC-8B4B-FE870659D985@.microsoft.com...
>
>|||in web.config:
<appSettings>
<add key="ConnectionString" value="Data Source=MyServer;Initial
Catalog=AdventureWorks;User Id=MyUser;Password=MyPassword;"/>
</appSettings>
in the web service:
string cnString =
ConfigurationManager.AppSettings.Get("ConnectionString");
Roman
Roman Rehak
http://sqlblog.com/blogs/roman_rehak
"wendld" <GenieLifts@.news.postalias> wrote in message
news:D1B8082F-16ED-47B7-9FD8-C5A1EBF26DED@.microsoft.com...[vbcol=seagreen]
> This is my first attempt at pulling in the connection string from the
> machine.config. Windows Authentication is not an option since the database
> and webservers are on different domains and a DMZ is in use. I currently
> have
> the SSL encryption on, but have not encrypted the actually value in the
> config file (yet). That is the next step after I get the programs working
> this way.
> "Roman Rehak" wrote:
>|||I am not using the appSettings section of the web.config. I was planning on
using the connectionstrings section of the machine.config. There will be man
y
applications using the same connection string and I feel it would be
appropiate to put there, I just don't know how to get to this section.
"Roman Rehak" wrote:

> in web.config:
> <appSettings>
> <add key="ConnectionString" value="Data Source=MyServer;Initial
> Catalog=AdventureWorks;User Id=MyUser;Password=MyPassword;"/>
> </appSettings>
> in the web service:
> string cnString =
> ConfigurationManager.AppSettings.Get("ConnectionString");
> Roman
> --
> Roman Rehak
> http://sqlblog.com/blogs/roman_rehak
>
> "wendld" <GenieLifts@.news.postalias> wrote in message
> news:D1B8082F-16ED-47B7-9FD8-C5A1EBF26DED@.microsoft.com...
>
>|||The code is the same whether you want to read from machine.config or
web.config. If you have the same value in both, web.config takes precedence.
Here is how you get a connection string from the connectionStrings section:
cnString =
ConfigurationManager.ConnectionStrings["ConnectionStringAW"].ConnectionS
tring;
Roman
Roman Rehak
http://sqlblog.com/blogs/roman_rehak
"wendld" <GenieLifts@.news.postalias> wrote in message
news:F14C7CAD-93C8-4EA4-8358-9FC2B2E8E681@.microsoft.com...[vbcol=seagreen]
>I am not using the appSettings section of the web.config. I was planning on
> using the connectionstrings section of the machine.config. There will be
> many
> applications using the same connection string and I feel it would be
> appropiate to put there, I just don't know how to get to this section.
> "Roman Rehak" wrote:
>

Friday, 24 February 2012

Conflict tables

Hello,
We are creating merge replication.
Is there any way to make the conflict tables to be create
in another database then the publisher database?
or to move them after creation.
Many Thanks for reply.
No, I don't think the conflict tables can be moved.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"DIRYU" <anonymous@.discussions.microsoft.com> wrote in message
news:653f01c49336$0acd99e0$a301280a@.phx.gbl...
> Hello,
> We are creating merge replication.
> Is there any way to make the conflict tables to be create
> in another database then the publisher database?
> or to move them after creation.
>
> Many Thanks for reply.

Conflict tables

Hello,
We are creating merge replication.
Is there any way to make the conflict tables to be create
in another database then the publisher database?
or to move them after creation.
Many Thanks for reply.No, I don't think the conflict tables can be moved.
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"DIRYU" <anonymous@.discussions.microsoft.com> wrote in message
news:653f01c49336$0acd99e0$a301280a@.phx.gbl...
> Hello,
> We are creating merge replication.
> Is there any way to make the conflict tables to be create
> in another database then the publisher database?
> or to move them after creation.
>
> Many Thanks for reply.

Sunday, 12 February 2012

Configuring Flat File Connection Programmatically?

I am programmatically creating a package in c#. I need this package to contain a flat file connection manager. I have been successfully able to create the connection manager with the following code:

Package p = new Package(); //New package

ConnectionManager cm = p.Connections.Add("FLATFILE"); //Add a flat file connection manager

cm.ConnectionString = "C:\Dev\myTestFile.txt"; //Set up the connection string

At this point, I want to configure the flat file specific properties of the connection manager (RowDelimiter, HeaderRowDelimiter, etc.). The problem is that the properties collection of the ConnectionManager object is read only. I think I could access the inner object of the connection manager and set the properties in the following way:

ConnectionManagerFlatFileClassffClass = (ConnectionManagerFlatFileClass) cm.InnerObject; //Get the inner object

ffClass .RowDelimiter = "{LF}"; //Set the properties here

Even if this would work, I do not like the solution b/c the BOL states that the ConnectionManagerFlatFileClass "supports the SQL Server 2005 infrastructure and is not intended to be used directly from your code". Does anyone know the "right" way to set these properties?

Many thanks in advance!

David

Figured it out - it looks like I spoke too soon - the BOL does indeed state how to do this:

cm.Properties["RowDelimiter"].SetValue(cm, "LF");

Friday, 10 February 2012

Configure Report Server with SQL Server Express with Advanced Services.

I'm having a world of trouble with the Reporting Services Server. The install went fine. I went in to configure the Report Server and when creating the Report Server and the Report Manager virtual directories I get the following error: "The virtual directory could not be created. The previously set virtual directory will still be used." The problem with this is that I have not previously set a virtual directory. When clicking on the link I get the additional error information: "System.IO.FileNotFoundException:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Management.ManagementObject.InvokeMethod(String methodName, ManagementBaseObject inParameters, InvokeMethodOptions options)
at ReportServicesConfigUI.WMIProvider.RSReportServerAdmin.CreateVirtualDirectory(String virtualDirectory, String path)"

When I check IIS the directories were created but the Reporting Services Configuration Manager does not see them unless I attempt to recreate them again without deleting them from IIS.

Anyone have any ideas as to this disconnect?

Thanks in advance!

By default RS is configured during installation so you shouldn't need to do any additional configuration. I'll ping the RS team to see if they have additional information about the error you're seeing.

Regards,

Mike Wachal
SQL Express team

-
Mark the best posts as Answers!

|||I have been unable in this case to allow RS to be configured during the install as selecting that option always caused an error. That error was something along the lines that it could not connect to the Report Database. The only way I could get the install to finish with no errors was to have it not configure RS.|||

This one dropped off my radar, sorry.

Were you ever able to get your Report Server running correctly. It seems that I found a similar behavior that I could only create new RS virtual directories if the folder already existed.

Regards,

Mike

|||I have having precisely the same problem. I cannot install Report Services as part of the original install of SQL Server since it has an error. So I install report services separately, but if you do that, it will not auto-configure, and when I use the config tool, I get the same error above.|||It seemed to be related to an improper installation of ASP.NET. I uninstalled ASP 2.0, then uninstalled 1.1, and reinstalled both of these and then manual configuration worked.|||

It is possible that you installed ASP.NET 2.0 before you installed IIS. The .NET Framework 2.0 has some special configurations that it does when IIS is installed that don't happen after the fact without running a special configuration file.

The alternative approach that you've found is to remove and reinstall the framework.

Regards,

Mike Wachal
SQL Express team

-
Mark the best posts as Answers!

|||

No, I am 100% certain that IIS and the 1.1 framework were present before I installed 2.0. I even tried aspnet_regiis -i for both 1.1 and 2.0 and that did not help. Since I did not personally install the 1.1 framework, since both it and IIS were installed from someone elses disk image, I cannot guarantee that they were configured properly.

|||

I am having problems with Reporting Services.

I go to http://localhost/reports and get error message:

"The report server is not responding. Verify that the report server is running and can be accessed from this computer."

In terms of configuration, I have set name of Report Server Virtual Directory to "ReportServer2", as it would not let me name it "ReportServer".

I have tried uninstalling .net framework v2 and reinstalling, but this does not help.

Any suggestions?

|||

I'm trying to manually configure my second reporting server instance. I used reports/$rserver as the virtual directory, (rserver is my instance name), and got error message:

"The virtual directory could not be created. The previously set virtual directory will still be used."

Then i used only reports as the virtual dir, the configuration wizard liked it and let me go through. But when i trid to open the URL http://localhost/reports, got the error message:

"The report server is not responding. Verify that the report server is running and can be accessed from this computer."

I verified my instance "rserver" was running and i'm sure i installed IIS before I installed SDK.Looks like some of us got the same problems here, have you figured it out yet?

By the way, i installed my only SQL server instance SQLEXPRESS and my first reporting service instance by default. They work fine.

Configure Report Server with SQL Server Express with Advanced Services.

I'm having a world of trouble with the Reporting Services Server. The install went fine. I went in to configure the Report Server and when creating the Report Server and the Report Manager virtual directories I get the following error: "The virtual directory could not be created. The previously set virtual directory will still be used." The problem with this is that I have not previously set a virtual directory. When clicking on the link I get the additional error information: "System.IO.FileNotFoundException:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Management.ManagementObject.InvokeMethod(String methodName, ManagementBaseObject inParameters, InvokeMethodOptions options)
at ReportServicesConfigUI.WMIProvider.RSReportServerAdmin.CreateVirtualDirectory(String virtualDirectory, String path)"

When I check IIS the directories were created but the Reporting Services Configuration Manager does not see them unless I attempt to recreate them again without deleting them from IIS.

Anyone have any ideas as to this disconnect?

Thanks in advance!

By default RS is configured during installation so you shouldn't need to do any additional configuration. I'll ping the RS team to see if they have additional information about the error you're seeing.

Regards,

Mike Wachal
SQL Express team

-
Mark the best posts as Answers!

|||I have been unable in this case to allow RS to be configured during the install as selecting that option always caused an error. That error was something along the lines that it could not connect to the Report Database. The only way I could get the install to finish with no errors was to have it not configure RS.|||

This one dropped off my radar, sorry.

Were you ever able to get your Report Server running correctly. It seems that I found a similar behavior that I could only create new RS virtual directories if the folder already existed.

Regards,

Mike

|||I have having precisely the same problem. I cannot install Report Services as part of the original install of SQL Server since it has an error. So I install report services separately, but if you do that, it will not auto-configure, and when I use the config tool, I get the same error above.|||It seemed to be related to an improper installation of ASP.NET. I uninstalled ASP 2.0, then uninstalled 1.1, and reinstalled both of these and then manual configuration worked.|||

It is possible that you installed ASP.NET 2.0 before you installed IIS. The .NET Framework 2.0 has some special configurations that it does when IIS is installed that don't happen after the fact without running a special configuration file.

The alternative approach that you've found is to remove and reinstall the framework.

Regards,

Mike Wachal
SQL Express team

-
Mark the best posts as Answers!

|||

No, I am 100% certain that IIS and the 1.1 framework were present before I installed 2.0. I even tried aspnet_regiis -i for both 1.1 and 2.0 and that did not help. Since I did not personally install the 1.1 framework, since both it and IIS were installed from someone elses disk image, I cannot guarantee that they were configured properly.

|||

I am having problems with Reporting Services.

I go to http://localhost/reports and get error message:

"The report server is not responding. Verify that the report server is running and can be accessed from this computer."

In terms of configuration, I have set name of Report Server Virtual Directory to "ReportServer2", as it would not let me name it "ReportServer".

I have tried uninstalling .net framework v2 and reinstalling, but this does not help.

Any suggestions?

|||

I'm trying to manually configure my second reporting server instance. I used reports/$rserver as the virtual directory, (rserver is my instance name), and got error message:

"The virtual directory could not be created. The previously set virtual directory will still be used."

Then i used only reports as the virtual dir, the configuration wizard liked it and let me go through. But when i trid to open the URL http://localhost/reports, got the error message:

"The report server is not responding. Verify that the report server is running and can be accessed from this computer."

I verified my instance "rserver" was running and i'm sure i installed IIS before I installed SDK.Looks like some of us got the same problems here, have you figured it out yet?

By the way, i installed my only SQL server instance SQLEXPRESS and my first reporting service instance by default. They work fine.