Showing posts with label based. Show all posts
Showing posts with label based. Show all posts

Monday, 19 March 2012

Connect SQL with Active Directory

Hi everybody. I have this problem: I have to access to the Active Directory of a remote server from my computer using SQL and make searches based on the LDAP of the server. Someone told me to use Add Linked Server, but I don't know how to do it with the Active Directory. Thanks for the help.

Please take a look at the link below for the solution:

http://msdn2.microsoft.com/en-US/library/ms190803.aspx

Books Online topics on linked servers are also useful to know. Note that there are however restrictions on what you can do via distributed queries. For example, some of the collection data types in the Active Directory Schema are not supported in SQL Server, number of rows that you can retrieve is restricted by default & so on.

|||

Linking SQL Server to Active Directory is tricky. and Microsoft support/help isn't very intuitive for this.
Check a few things first...
1. two single quotes not double.
2. Make connection w/out security context.


Follow this syntax:
EXEC master.dbo.sp_addlinkedserver @.server = N'ADSI',
@.srvproduct=N'Active Directory Services', @.provider=N'ADsDSOObject',
@.datasrc=N'Servername.domain.com' --AKA the full computer name of the AD server

Then execute the openquery like this:

select * from openquery
(
ADSI,'SELECT name
FROM ''LDAP://Servername.domain.com''
WHERE objectCategory = ''Person'' AND objectClass = ''user''
')

I couldn't find anything on the Internet that would help me.

Connect SQL with Active Directory

Hi everybody. I have this problem: I have to access to the Active Directory of a remote server from my computer using SQL and make searches based on the LDAP of the server. Someone told me to use Add Linked Server, but I don't know how to do it with the Active Directory. Thanks for the help.

Please take a look at the link below for the solution:

http://msdn2.microsoft.com/en-US/library/ms190803.aspx

Books Online topics on linked servers are also useful to know. Note that there are however restrictions on what you can do via distributed queries. For example, some of the collection data types in the Active Directory Schema are not supported in SQL Server, number of rows that you can retrieve is restricted by default & so on.

|||

Linking SQL Server to Active Directory is tricky. and Microsoft support/help isn't very intuitive for this.
Check a few things first...
1. two single quotes not double.
2. Make connection w/out security context.


Follow this syntax:
EXEC master.dbo.sp_addlinkedserver @.server = N'ADSI',
@.srvproduct=N'Active Directory Services', @.provider=N'ADsDSOObject',
@.datasrc=N'Servername.domain.com' --AKA the full computer name of the AD server

Then execute the openquery like this:

select * from openquery
(
ADSI,'SELECT name
FROM ''LDAP://Servername.domain.com''
WHERE objectCategory = ''Person'' AND objectClass = ''user''
')

I couldn't find anything on the Internet that would help me.

Thursday, 8 March 2012

Connect 2 DropDownList and Received "Input string was not in a correct format"

I have 2 DropDownList, the first one to display the product category and the other one to display the products based on the selected category. However, when I run code I received the following error message:Input string was not in a correct format.

Please find the code below.

Thanks,

Andy.

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

<!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">

<headrunat="server">

<title>Untitled Page</title>

</head>

<body>

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

<div>

<asp:DropDownListID="DropDownList1"runat="server"DataSourceID="SqlDataSource1"

DataTextField="Name"DataValueField="Name">

</asp:DropDownList>

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:Assignment2ConnectionString %>"

SelectCommand="SELECT [Name] FROM [Category]"></asp:SqlDataSource>

<br/>

<asp:DropDownListID="DropDownList2"runat="server"DataSourceID="SqlDataSource2"

DataTextField="Name"DataValueField="Name">

</asp:DropDownList>

<asp:SqlDataSourceID="SqlDataSource2"runat="server"ConnectionString="<%$ ConnectionStrings:Assignment2ConnectionString %>"

SelectCommand="SELECT [Name] FROM [Product] WHERE ([CategoryID] = @.CategoryID2)">

<SelectParameters>

<asp:ControlParameterControlID="DropDownList1"Name="CategoryID2"PropertyName="SelectedValue"

Type="Int32"/>

</SelectParameters>

</asp:SqlDataSource>

</div>

</form>

</body>

</html>

Assume you have a categoryID field in your Category table: You add CategoryID to the SELECT statement and changeDataValueField="CategoryID" .

<asp:DropDownListID="DropDownList1"runat="server"DataSourceID="SqlDataSource1"

DataTextField="Name"DataValueField="CategoryID">

</asp:DropDownList>

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:Assignment2ConnectionString %>"

SelectCommand="SELECT [Name],[CategoryID] FROM [Category]"></asp:SqlDataSource>

<br/>

Wednesday, 7 March 2012

Confusion about rs.Render method and reportPath argument

I'm trying to issue the Render method based on some samples I've tried
to adapt and I am getting errors about the path.
The doc states the first parameter to be passed to the Render method is
the "full path name of the report".
I'm not sure what is wanted there.
I currently have 2 projects in my .sln file: one is my web app which
has a web reference to the RS webservice and the other is a report
project. Here is a code snippet:
Dim rs As New ReportingService
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
'rs.Url = "localhost/ReportService.asmx"
Dim proxyParameters(0) As ParameterValue
proxyParameters(0) = New ParameterValue
proxyParameters(0).Name = "DataSource"
' get serialized dataset
proxyParameters(0).Value = objDataSet.GetXml()
' Render arguments
Dim result As Byte() = Nothing
'Dim reportPath As String = "/SampleReports/Employee Sales
Summary"
Dim reportPath As String = "/RD/Reports/MarketShare"
Dim format As String = "PDF" 'was "MHTML"
Dim historyID As String = Nothing
Dim devInfo As String = "<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>"
Dim credentials As DataSourceCredentials() = Nothing
Dim showHideToggle As String = Nothing
Dim encoding As String
Dim mimeType As String
Dim warnings As Warning() = Nothing
Dim reportHistoryParameters As ParameterValue() = Nothing
Dim streamIDs As String() = Nothing
Dim sh As New SessionHeader
rs.SessionHeaderValue = sh
Try
result = rs.Render(reportPath, format, historyID, devInfo,
proxyParameters, _
credentials, showHideToggle, encoding, mimeType,
reportHistoryParameters, warnings, streamIDs)
sh.SessionId = rs.SessionHeaderValue.SessionId
Console.WriteLine("SessionID after call to Render: {0}",
rs.SessionHeaderValue.SessionId)
Console.WriteLine("Execution date and time: {0}",
rs.SessionHeaderValue.ExecutionDateTime)
Console.WriteLine("Is new execution: {0}",
rs.SessionHeaderValue.IsNewExecution)
Catch eX As SoapException
Console.WriteLine(eX.Detail.OuterXml)
End Try
I get:
<Message
xmlns="http://www.microsoft.com/sql/reportingservices">The item
'/RD/Reports/MarketShare' cannot be found.</Message>
I have my report file called Marketshare.rdl in the Reports folder of
my report project I call RD. Do I need to create a virtual directory to
hold my .rdl files? I've tried adding the file extension .rdl to this
reportPath string and that gives the same error. Please help me with
what I am missing. Thank you.Hi,
The ReportPath where the rs.Render method is needing is the complete path at
the ReportServer.
When you have create your reports in VS.NET 2003 you have to deploy them to
your ReportServer. The deploy server you have to define in the properties of
your Report project file (TargetServerURL usally
http://localhost/ReportServer). Also in this properties you can define a
report Path (TargetFolder)
This TargetFolder and your Report Filename are the complete reportParh.
e.g. You have set the TargetFolder to TestReport and you deploy a report
Report1.rdl to the server your reportPath will be: /TestReport/Report1
Jan Pieter Posthuma
"JJA" wrote:
> I'm trying to issue the Render method based on some samples I've tried
> to adapt and I am getting errors about the path.
> The doc states the first parameter to be passed to the Render method is
> the "full path name of the report".
> I'm not sure what is wanted there.
> I currently have 2 projects in my .sln file: one is my web app which
> has a web reference to the RS webservice and the other is a report
> project. Here is a code snippet:
> Dim rs As New ReportingService
> rs.Credentials = System.Net.CredentialCache.DefaultCredentials
> 'rs.Url = "localhost/ReportService.asmx"
> Dim proxyParameters(0) As ParameterValue
> proxyParameters(0) = New ParameterValue
> proxyParameters(0).Name = "DataSource"
> ' get serialized dataset
> proxyParameters(0).Value = objDataSet.GetXml()
> ' Render arguments
> Dim result As Byte() = Nothing
> 'Dim reportPath As String = "/SampleReports/Employee Sales
> Summary"
> Dim reportPath As String = "/RD/Reports/MarketShare"
> Dim format As String = "PDF" 'was "MHTML"
> Dim historyID As String = Nothing
> Dim devInfo As String => "<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>"
> Dim credentials As DataSourceCredentials() = Nothing
> Dim showHideToggle As String = Nothing
> Dim encoding As String
> Dim mimeType As String
> Dim warnings As Warning() = Nothing
> Dim reportHistoryParameters As ParameterValue() = Nothing
> Dim streamIDs As String() = Nothing
> Dim sh As New SessionHeader
> rs.SessionHeaderValue = sh
> Try
> result = rs.Render(reportPath, format, historyID, devInfo,
> proxyParameters, _
> credentials, showHideToggle, encoding, mimeType,
> reportHistoryParameters, warnings, streamIDs)
> sh.SessionId = rs.SessionHeaderValue.SessionId
> Console.WriteLine("SessionID after call to Render: {0}",
> rs.SessionHeaderValue.SessionId)
> Console.WriteLine("Execution date and time: {0}",
> rs.SessionHeaderValue.ExecutionDateTime)
> Console.WriteLine("Is new execution: {0}",
> rs.SessionHeaderValue.IsNewExecution)
> Catch eX As SoapException
> Console.WriteLine(eX.Detail.OuterXml)
> End Try
> I get:
> <Message
> xmlns="The">http://www.microsoft.com/sql/reportingservices">The item
> '/RD/Reports/MarketShare' cannot be found.</Message>
> I have my report file called Marketshare.rdl in the Reports folder of
> my report project I call RD. Do I need to create a virtual directory to
> hold my .rdl files? I've tried adding the file extension .rdl to this
> reportPath string and that gives the same error. Please help me with
> what I am missing. Thank you.
>

Sunday, 19 February 2012

Configuring SSIS package to read a value before executin

Hi,

Is it possible in any ways to Configure a SSIS package in such a way that based on the User Input the package runs. For e.g if there is a table which has say 10 distinct groups. Normal SSIS package would ideally pick all the data from the source to the Destination

I want to know how to configure in Such a way that I should be able to say Group X as the input and data related to GroupX alone should be copied.

Select * from SomeTable where GroupName = @.CongigVar.

how to achieve something like this?

thanks

Hello,

What kind of input are you intrested in getting?

If you have the group name that you want to get information from in a table, you can, in control flow, make a query to a table, and put it on a variable, then on the data flow you can use the variable as a parameter.

To use it on a parameter your query should be

"Select * from SomeTable where GroupName = ?"

Then in the parameter button on the left you choose the variable that will pass tha value to the question mark.

Is that good for you?

Regards,

|||

Hello,

I think that might just be what I need, but when I tried creating one, its failing with the error, 'Parameter Name Unrecognized'. I think am doing it wrongly. Can you post some links that explains how to put a value from a table onto a variable, and then use it as i/p to a Data flow?

thanks

|||

Nfrf wrote:

Hello,

What kind of input are you intrested in getting?

If you have the group name that you want to get information from in a table, you can, in control flow, make a query to a table, and put it on a variable, then on the data flow you can use the variable as a parameter.

To use it on a parameter your query should be

"Select * from SomeTable where GroupName = ?"

Then in the parameter button on the left you choose the variable that will pass tha value to the question mark.

Is that good for you?

Regards,

There's no need to store values in a table. You can parameterize your package by passing it values when you call it. Explore the /SET option of dtexec. All the information you require is in Books Online.

-Jamie

|||

Yes it is true. I just gave him a way.

The thing that i thnik he wanted to know was the parameter on the query.

Even so thanks

Friday, 10 February 2012

Configure SQL Server on Web Server!!

I recently have configured a web server based on Windows 2003 Server and IIS 5. I'd installed SQL Server 2005 on to it. I want this SQL server to be accessiable to my clients for their data storage purpose. I want to configure this sql server accessiable to them through a DNS name. My domain name is www.talons.com.np. How can i do this? I need your all kind support in this regard.

It is not clear what your clients are going to use to access the server.
Could you clarify your plans?|||

Please do not double post. As indicated in the other post, if you want them connect to the SQL Server machine by DNS name, you can configure a port redirection on your outside router to route the incoming connections on port 1433 to the SQL Server.

Jens K. Suessmeyer

http://www.sqlserver2005.de

Configure SQL Server 2000 on Web Server accessible to client!!

I recently have configured my Web Server based on Windows 2003 Server and IIS 5x. I'd also installed SQL Server 2005 into this. Now I want toc onfigure this SQL Server, so that my client can access their database through a DNS name. I request you all for your kind support in this regard. Thanks in advance.

Datbased are not access by DNS Name. Default instances of server are accessed through DNS Names. Using the syntax for the default server e.g. Computername or for a named instance ComputerName\InstanceName should do the trick. If you want to reach the instances by just a name, without the \ within the name, you will have to configure an alias for them on each client machine.

Jens K. Suessmeyer

http://www.sqlserver2005.de

Configure SQL Server 2000 on a Web Server accessible to client!!

I have recently configured a Web Server based on Windows 2003 Server and IIS 5x. I'd also installed SQL Server 2005 into this. Now I want toc onfigure this SQL Server, so that my client can access their database through a DNS name. I request you all for your kind support in this regard. Thanks in advance.

PLease do not double post, see the answer in (one of your) other threads.

Jens K. Suessmeyer

http://www.sqlserver2005.de