Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Wednesday, March 28, 2012

how to make select query to access view in other server

Dear All,

i am making small web application using asp.net, C# ,sql2000.

i want a about regarding how to access view or table from other server to local server. i have base database where there is a view which need to access in my database of local server.
that is how to make select query to access view in other server

Please help


thanks

You have to add you second server to linked servers (server objects-> linked servers-> right click new linked server) and next in your query use server name in table name like:

select * from [server].[database].dbo.[tablename]

or use open query

Select * from OPENQUERY([servername],'SELECT * from [database].dbo.[tablename]')

second is faster but use it only if your query will hit only data on second server.

Thanks

sql

how to make select query to access view in other server

Dear All,

i am making small web application using asp.net, C# ,sql2000.

i want a about regarding how to access view or table from other server to local server. i have base database where there is a view which need to access in my database of local server.
that is how to make select query to access view in other server
Please help


thanks

there are many ways to access other server.database.table

(a) Configure LinkedServer

b)OPENDATASOURCE

(c) OpenQuery

read about this in BOL

Madhu

How to make Report Caching work when rendering a report through the Web Services method Re

I've read carefully about the section "Report Caching in Reporting Services"
on the online document. It seems to me that report caching only works for
URL accesss. I use the web service method Render to render a report content,
and set cache option TimeExpiration.minutes = 20. However, each time when a
user make a Http request, the proxy object of ReportingService is recreated,
and it's Render method gets executed no matter whether the Cache option has
been set up or not. Is there any way that when I call the method "Render"
and tell this method to render from the cached report content instead of
reexecuting the report processing?It should automatically render from the cached report even in SOAP access.
You can test this by reading the SOAP header SessionHeader and checking the
IsNewExecution property. There is an example of this in Books Online. Seach
for SessionHeader.
--
Bryan Keller
Developer Documentation
SQL Server Reporting Services
A friendly reminder that this posting is provided "AS IS" with no
warranties, and confers no rights.
"Wendy H" <WendyH@.tequilasoftware.com> wrote in message
news:e7X9c$abEHA.212@.TK2MSFTNGP12.phx.gbl...
> I've read carefully about the section "Report Caching in Reporting
Services"
> on the online document. It seems to me that report caching only works for
> URL accesss. I use the web service method Render to render a report
content,
> and set cache option TimeExpiration.minutes = 20. However, each time when
a
> user make a Http request, the proxy object of ReportingService is
recreated,
> and it's Render method gets executed no matter whether the Cache option
has
> been set up or not. Is there any way that when I call the method "Render"
> and tell this method to render from the cached report content instead of
> reexecuting the report processing?
>|||I did something wrong, which reset cache option everytime when the render
method was called. After I move these codes into some other place, the
report caching works just as good as the one in Report Manager.
"Bryan Keller [MSFT]" <bryanke@.online.microsoft.com> wrote in message
news:eM6gh%23nbEHA.3988@.tk2msftngp13.phx.gbl...
> It should automatically render from the cached report even in SOAP access.
> You can test this by reading the SOAP header SessionHeader and checking
the
> IsNewExecution property. There is an example of this in Books Online.
Seach
> for SessionHeader.
> --
> Bryan Keller
> Developer Documentation
> SQL Server Reporting Services
> A friendly reminder that this posting is provided "AS IS" with no
> warranties, and confers no rights.
>
> "Wendy H" <WendyH@.tequilasoftware.com> wrote in message
> news:e7X9c$abEHA.212@.TK2MSFTNGP12.phx.gbl...
> > I've read carefully about the section "Report Caching in Reporting
> Services"
> > on the online document. It seems to me that report caching only works
for
> > URL accesss. I use the web service method Render to render a report
> content,
> > and set cache option TimeExpiration.minutes = 20. However, each time
when
> a
> > user make a Http request, the proxy object of ReportingService is
> recreated,
> > and it's Render method gets executed no matter whether the Cache option
> has
> > been set up or not. Is there any way that when I call the method
"Render"
> > and tell this method to render from the cached report content instead of
> > reexecuting the report processing?
> >
> >
>

Monday, March 26, 2012

how to make column lowercase

I have a table that contains names that are all in upper case, this column is called in many different areas of my web app. I wanted to make the names all lowercase, or with the leading character only capitalized.
How can I make a column within a SQL table lowercase at the SQL server end and not the programming side?

thanks,
Frank


UPDATE
TableName
SET
FieldName = LCASE(FieldName)

For all future entries, you create a trigger that will execute on insert.|||If you are talking about the data to be converted in lowercase, then following is the syntax:

select lower(column_name) from table_name

To convert first letter in Capital, you could write your own function, using UPPER, LOWER, SUBSTRING and CHARINDEX.
You can use CHARINDEX to find the spaces, then UPPER the character following each space.|||How can I do this automatically in the Formula field of the Table Design.

thanks

Friday, March 23, 2012

How to make a diagram from data in a SQL Server table?

Hi all,

I′m a real SQL rookie and after two days of intensive research and reading of dozens of articles and web pages a bit confused about all that knowledge concerning database technology ... and I only want to do something very easy ...

Now, my question is, how can I produce a diagram from that data, that is stored in a table, maybe called "DiagData1"?

I have installed SQL Server Express 2005 and Visual Basic Express 2005 and did some first steps with it as where shown in an brilliant tutorial that I′ve found on a Microsoft (?) webpage. It shows the complete way building a database and connecting it to a form which was build with Visual Basic. So all what is left is find out how the database tables are connected to a diagram.

thanks′n greets,

VBFan

Hi all,

after long hours of reading and testing there′s some success now. Taking some lines from the online help I′ve done the following VB-prog that produces lines on the form when the button is pushed.

Now I would like to know how the button can be added by the prog at runtime. When I try it with the lines, that are commented out, I get an error.

Does anybody have the solution?

Thank you and greetings,

VBFan

Public Class Form1

Dim clI As Integer = 0

' Private Button1 As New Button()

'Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

' Me.Controls.Add(Button1)

' Button1.Height = 100

' Button1.Text = "Draw Line"

'End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)

Dim formGraphics As System.Drawing.Graphics

formGraphics = Me.CreateGraphics()

formGraphics.DrawLine(myPen, 0, 0, 200, 200 + clI)

clI = clI + 10

myPen.Dispose()

formGraphics.Dispose()

End Sub

End Class

sql

Wednesday, March 21, 2012

How to maintain users permission and access level

Hi guys,

We have a scenario where there are about 50 tables in our database and we want to build an intranet web application for users to with the office to access those tables.

Users ability to access tables falls into diferent category:

Some users can NOT view some tables at allSome users can ONLY view some tables but not insert/update any fieldSome users can view and also insert/update some tables (in the same time they might not have view(select) permision on some other tables)

Now, what is the right way to implement this.

I say we have to have a Role, RolePermission, User, UserPermission inside our database to implement this (something which would look like the Roles and Users inside MSSQL) and we only have one user for our Database (MachineName/ASPUSER) to access the database and all the tables within

My colleague says NO, instead of creating all these tables and implement this, we add every user of our application as a Database user inside MSSQL in the Databse Users.

All the web application I have seen so far, DNN, CommunityServer, ... the have tables to implement all these and they don't add users inside the MSSQL.

Now which way is the way to go with, and what problem might we fall into if we use SQL users, is this possible at all. How can I convince him that we have to make and use our own tables to manage this.

Thanks for any help,
Mehdi

If you are using asp.net 2.0 you can use login controls and restrict the users to access particular forms.

Other way is to use Windows based authentication. As you are creating Intranet based application...every user will have windows ID. You can restrict the user to access the database.

To learn about Windows Based Authentication, visit the following link:

http://msdn2.microsoft.com/en-us/library/aa480475.aspx

To learb about login controls, watch the video tutorial for Membership and Roles

http://www.asp.net/learn/videos/default.aspx?tabid=63#howdoi

|||go to http://www.codeproject.com/csharp/cgsecurity3.aspit was presented a library for managing user-level credentials

How to loop thru' Fields in Report

I'm using Reporting Server 2005. I have published my report as Web service. Now I'm accessing the Web Service (Report) from my C# code. Here I would like to loop all the fields available in the report. How to do this?

Thanks in Advance.

Regards,

vnisor.

Have you considered using one of the data renderers (such as XML)? When you render it will only return the data in the report and not any formatting. It should make it much easier to extract the data you are interested in programmatically.

How to login to SQL Server Web Data Administrator?

I have installed Microsoft SQL Server 2000 Desktop Engine (MSDE 2000) and the SQL Server Web Data Administrator. After I run the SQL Server Web Data Administrator it
is asking me for login and password. How can I determine my login and password? Thank you.Try using "sa" for login (without the quotes) and a blank password. After you login, make sure you change the password to something non-blank!

Monday, March 19, 2012

how to lock a table or row in sql?

hi, i have an application that updates some records in sql tables, and i want to do a web application that updates records in the some database-table(sql) so, my question is how can i lock the row or table so i dont have concurrency problems.
tnx in advance.Have you tried google? Search fordatabase concurrency.
It's not a simple answer. There are different types of concerrency and different levels of locks. You need to undestand what is out there. Once you get the difference, you'll probably know what to use and how to do it.
Now go. Google it.|||

ok , i will try doing something like in this article..

http://www.15seconds.com/issue/030604.htm

tnx Alex.

Friday, March 9, 2012

How to leverage custom security with ReportViewer and SSRS Web Service

My company is building a WindowsForms application that will use SSRS 2005 for it's reporting needs. The application will use ClickOnce and will run in an extranet type of environment against a centralized database designed in an "ASP" fashion with key, customer-specific tables marked with an "OrgId."

The authentication/authorization within the app will be with custom classes implementing IPrincipal and IIdentity and leveraging the built-in .NET security framework. Because of this, I have come to the conclusion that we will have to author a custom security extension for SSRS.

Now, none of this is rocket science, but we would like to use the Windows Forms ReportViewer control within our app, in conjunction with the Reporting Services Web Service and I have yet to find a decent example that illustrates how to utilize custom security extensions with the web service and the reportviewer.

Any suggestions, tips, tricks, pitfalls?

Thanks,
Matthew Belk

This stuff is in BOL, but it's not very discoverable.

Here's an example of using the SSRS Forms Auth security extension in conjunction with the ReportViewer:

http://blogs.msdn.com/bimusings/archive/2005/11/04/489100.aspx

Here's an example of using the Forms Auth Security extension with the SSRS webservice (basically, just calling LoginUser(): implemented in the security extension)

http://blogs.msdn.com/bimusings/archive/2005/08/04/447939.aspx

Hope this helps

|||Thanks for the blog pointers.

Now, the next logical question is how to leverage the custom security extensions to restrict access to various items within the SSRS space so that the custom "CheckAccess" routines from the sample code will work properly.

I'd love to let SSRS handle this, but if the answer is "You have to do that from your app," then that's OK, too.

Thanks,
Matthew Belk
|||

Have you explored the Forms Auth security extension sample yet? If not, I would -- You could pretty much use 60-70% of it for your purposes (authorization included)...The only changes you'd have to make is how LogonUser gets handled, etc.