Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

Monday, March 12, 2012

How to add newline in column of type nvarchar

Hi,
I want to add a newline in a content of sql column (using t-sql and not asp.net textbox) so when content is being rendered in a .net textbox I get separate rows, so instead
col1 col2 col3
I woule like to have
col1
col2
col3
Thanks

You can use CHAR(13) to insert a carriage return into the string. e.g.

INSERT INTO MyTable (MyStringColumn) VALUES('My name is'+CHAR(13)+'Colin Mackay')
See also SQL Server Books-On-Line:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ca-co_6xte.asp
Does this help?

|||Yes, that's it, thanks

Friday, March 9, 2012

how to add data to my tables (was "SQL Server Newbie")

Hi. I just set up my first sql server database and I've managed to connect to it via ASP as a test.
I'm not sure how to add data to my tables. In MS Access, you can edit the table and add records. How do I do that in SQL Server?
I'm using the Enterprise manager tool to create tables... does it have something i can use?

ThanksThe sky's the limit on how you can add and edit data in SQL tables, but comparable to what you said about editing tables in access... In EM, you can right click a table then select to open table and return all rows, top or specifiy a query. (I usually use top 1 if I plan on adding rows)

I would advise using query analyzer to do any editing though. Much easier and more efficient IMHO.|||When I try to return rows by right clicking on the table, i get an error that says:
An unexpected error happened during this operation.
Query Designer encountered a Query Error: Unspecified error.

??|||If all else fails, and you have primary keys on your tables, you can always just link the tables in MS Access. As Dr_Clong advised, though, you probably want to pick up a book on Transact-SQL. I liked Sams Publishing's "Teach Yourself in 21 Days" book.|||ok... so it sounds like i have to write sql INSERT statements to add data...??
Sorry if that's a dumb question.
I'll look up some books on transact sql.|||I don't know your setup or for that matter what could be causing your error, but I agree the best way to start out is by educating yourself on SQL Server tools and TSQL.|||1. Stop using Enterprise Manager

2. Start Using Query Analyzer

3. Open Books Online and Leave it Open

4. INSERT INTO myTable99(Col1, Col2, Col3) SELECT 'x','y','z'

5. Or bcp data in from flat files

6. Have a Margarita!

7. Post here often

8. Have Another Margarita

9. Go to 8.

how to add aspnet user to sqlexpress

Hi guys

I am trying to add aspnet user to sqlexpress. I am able to select the asp.net however when I click on OK button,

it is asking me to enter a name for it. COuld you tell me what name I should enter? I tried computername\aspnet didn't help?

is there better way to do this?

thanks for your help

Cemal

Hi patron,

What are the steps you did for creating user? We can simply create user by following steps:

In Management Studio, locate to Server name | Security | Logins, right click Logins node and select "New Login…", click Search button in General panel. Then the "Select User or Group" dialog appears. Please be sure the location is your computer name. Input ASPNET or Network Service in the TextBox and then click "Check Names".

Wednesday, March 7, 2012

How to add an identity PK column to a View

For an ASP.net project, I have had a DropDownList with a static ArrayList.
The ArrayList will be defined from a View, where there is no Identity PK.

I also have used cbxDropDownListName.SelectedIndex to add new data to
a table, where an Indetity PK is used to reference the ArrayList.

I am wondering how can I add an identity PK to my view?

TIA,
Jeffrey

Why don't you select an identity column from one of the tables in the view? Pick an identity column that, by the view definition, would be unique in the view result set.

How to add a URL to a ASP page into the Reporting Services folder

I want to add the URL to a ASP page into the Reporting Services Folder.
We are sort of using the Reporting Services as a portal to our other
reporting applications. I want to include the URL to a ASP page in a
reporting services folder not sure how to do this.
Please help with a simple URL scenario.
Thanks
Karenfirst add a web reference to ASP project
then define parameters of Reporting Service.render()
the url is a parameter of that function.
it works well on ASP.NET
but i do not know whether it is available on ASP|||Sorry, all I want to do is add an HTML page URL link to a reporting
services folder. I could not find much information on how to do this in
report manager.
Thanks
Karen|||the url is like that http://localhost/ReportServer?/sample
rs/Nametag&rs:Format=pdf
some of the url parameters are BookimakrID,DocMap, EndFind,FallbackPage|||So how do I publish the link to a URL into the Report Folder
Thanks
Karen|||All I want to do is put URLs to other applications and HTML pages into
the RS Folder. So sort of I want to use it as a portal not just as a
means to reach only reports
Thanks
Karen|||The only way I am aware of how to do this is to add a page that has the
links. You can create an HTML page and then add it to your report project
and deploy it.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<karenmiddleol@.yahoo.com> wrote in message
news:1131673239.202311.213960@.f14g2000cwb.googlegroups.com...
> All I want to do is put URLs to other applications and HTML pages into
> the RS Folder. So sort of I want to use it as a portal not just as a
> means to reach only reports
> Thanks
> Karen
>

Sunday, February 19, 2012

How to access Webservice from SQL Server 2000

Hi All,
How to access / invoke a webservice from SQL Server 2000? i.e, from within a
SP i would like to call an existing webservice.
I know using HTTPEndPoints we can do that in SQL 2005. Is there any work
arounds in SQL 2k?
Regards
PradeepI am not too sure whether this is what you are looking for! Anyways just
check this out
http://msdn.microsoft.com/msdnmag/issues/02/05/SQLXML3/ -- Build
Data-Driven Web Services with Updated XML Support for SQL Server 2000
Best Regards
Vadivel
http://vadivel.blogspot.com
"SqlBeginner" wrote:

> Hi All,
> How to access / invoke a webservice from SQL Server 2000? i.e, from within
a
> SP i would like to call an existing webservice.
> I know using HTTPEndPoints we can do that in SQL 2005. Is there any work
> arounds in SQL 2k?
> Regards
> Pradeep|||It's not easy and I'm not sure if you can do it but you may be able to
access a DLL from the sp_OA* OLE automation procs. The DLL would likely
need to have a COM+ wrapper. The DLL would then call the web service. I
haven't tried this, though.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
"SqlBeginner" <SqlBeginner@.discussions.microsoft.com> wrote in message
news:9B8A5DE2-08AB-4BCB-9EA7-1557D6CE7541@.microsoft.com...
Hi All,
How to access / invoke a webservice from SQL Server 2000? i.e, from within a
SP i would like to call an existing webservice.
I know using HTTPEndPoints we can do that in SQL 2005. Is there any work
arounds in SQL 2k?
Regards
Pradeep|||Just make sure it doesn't wrap any managed code:
http://support.microsoft.com/defaul...kb;en-us;322884
:-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:OvPR%23LyfGHA.2188@.TK2MSFTNGP04.phx.gbl...
> It's not easy and I'm not sure if you can do it but you may be able to
> access a DLL from the sp_OA* OLE automation procs. The DLL would likely
> need to have a COM+ wrapper. The DLL would then call the web service. I
> haven't tried this, though.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> "SqlBeginner" <SqlBeginner@.discussions.microsoft.com> wrote in message
> news:9B8A5DE2-08AB-4BCB-9EA7-1557D6CE7541@.microsoft.com...
> Hi All,
> How to access / invoke a webservice from SQL Server 2000? i.e, from within
a
> SP i would like to call an existing webservice.
> I know using HTTPEndPoints we can do that in SQL 2005. Is there any work
> arounds in SQL 2k?
> Regards
> Pradeep
>|||Well, there ya go. Another reason to move on to SQL 2005. ;-)
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uA0$eYyfGHA.1792@.TK2MSFTNGP03.phx.gbl...
Just make sure it doesn't wrap any managed code:
http://support.microsoft.com/defaul...kb;en-us;322884
:-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:OvPR%23LyfGHA.2188@.TK2MSFTNGP04.phx.gbl...
> It's not easy and I'm not sure if you can do it but you may be able to
> access a DLL from the sp_OA* OLE automation procs. The DLL would likely
> need to have a COM+ wrapper. The DLL would then call the web service. I
> haven't tried this, though.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> "SqlBeginner" <SqlBeginner@.discussions.microsoft.com> wrote in message
> news:9B8A5DE2-08AB-4BCB-9EA7-1557D6CE7541@.microsoft.com...
> Hi All,
> How to access / invoke a webservice from SQL Server 2000? i.e, from within
> a
> SP i would like to call an existing webservice.
> I know using HTTPEndPoints we can do that in SQL 2005. Is there any work
> arounds in SQL 2k?
> Regards
> Pradeep
>|||How many web services actually existed in 1999/2000?
ML
http://milambda.blogspot.com/|||Well said.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
"ML" <ML@.discussions.microsoft.com> wrote in message
news:DDACAEC9-BF52-48F2-9C9E-5E4E0E27433D@.microsoft.com...
How many web services actually existed in 1999/2000?
ML
http://milambda.blogspot.com/

How to access the SQL mobile database(.sdf) using ASP.Net?

How to access the SQL mobile database(.sdf) using ASP.Net?

When i try to add the System.Data.SqlServerCe.dll as a Reference it shows the following error.

Error 1 Could not load file or assembly 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

You must browse to this folder: C:\Programmer\Microsoft SQL Server Compact Edition\v3.1 and add the reference from there. In addition, you must follow the instructions in this article http://msdn2.microsoft.com/en-us/library/system.data.sqlserverce.sqlceconnection.aspx if you want to use the SqlCeConnection. Also note the advice on performance problems with SQL CE and asp.net. Please not there is a documentation error, see here for the correct syntax:

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

How to access the DB with Integrated Security

Hello,

I'm new to ASP, but developping in Sql for years.

What we would like to have is that the user is accessing the database over it's own Windows Logon. Our triggers log quite some changes and are using UserName() for this. I've treid to force the IIS to accept Windows Integration only, the SqlDataSource users a connection that has Integrated Security = True. But when connection to the site i'm gatting error that there is no trusted connection for the user . (dot) ...

I suppose i'm missing something but could you give me a hint where to start looking.... THX

Hello my friend,

Is the database and the website running on the same domain? I ask because it may be that the SQL Server has no recognition of the Windows account being used on the website server. To cater for future requirements, including the ability of third parties to be able to access this data source, I would use SQL Server authentication (but not the sa account!). Create a sql server user with restrictions on the tables/views/procedures/etc they can use. This is much more secure and extendable than the Windows approach.

Kind regards

Scotty

|||

It is on the same domain.

The mean reason for trying this approach is the triggering, in our classic applications we use the windowslogon and so we can use the username() function in our triggers to log who has changed what values when ... when using a common user we would loose this functionallity, That's why we tried to do this.

A bit stange to me is the proposal of this sql user. And i've seen it in most of the posts i've been reading on these problems, because, the first thing in every book on Sql Security is to close down the SqlServer Logins, and here you have to use them !!

|||

Yes and no.

You force the users to connect as SQL logins and then you restrict these logins as much as possible, as opposed to a Windows account. You can configure a sql user to only allow read-only access to 1 column in 1 table out of the whole database if necessary. Disallow everything and then allow as necessary is an approach all of the security books will endorse. I find that the best books on SQL come from Wrox.

Kind regards

Scotty