Showing posts with label control. Show all posts
Showing posts with label control. Show all posts

Sunday, March 25, 2012

GridView

Hi
I need to add in gridview control asp code "delete from t1 whereid=@.id1"
how to declare @.id1 because the server give me mistake
down is the code of asp i use GridView how i can link @.id with field there id?

Thank u and have a nice day
best regards
the code if u need it i use c#

<ASP:SQLDATASOURCE id=SqlDataSource1 <br ConnectionString="<%$ ConnectionStrings:libraryConnectionString %>" runat="server"><BR></ASP:SQLDATASOURCE></ASP:BOUNDFIELD

I don't understand what the <br is doing in the tag, as well as why the data source control is in a bound field; I don't believe BoundField allows text in the tag, as well as child controls.

But you do that through:

<asp:sqldatasource id="s" runat="server" ConnectionString=".." DeleteCommand="yoru query">
<DeleteParameters>
<asp:Parameter Name="@.id" Type="Integer" />
</DeleteParameters>
</asp:sqldatasource>

Something like that.

Monday, March 19, 2012

.sql control string

My development environment includes Visual Web Developer, SQL Server 2005 Express and SQL Server Management Studio Express. I have a .sql control string that creates a database. The control string is in my App_Data folder within my web site. When I use SQL Server Managment Studio Express to run the .sql control string and create the tables etc. it does it in my SQLEXPRESS folder and not in the web.

How do I run the .sql file so it will create the database in my App_Data folder within the web site?

Thanks,

Kyleq

Hi Kyleq,

Please make sure that your SQL Server Management Studio Express has connected to the correct database.

A simple .mdf file cannot be working properly, we must

1. Attach it to a SQL Server instance.
2. Connection the SQL Server Management Studio Express to that instance and to that database.
3. Run the .sql scripts.
4. Detach the database.

Please read the following for more information:

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

HTH. If this does not answer your question, please feel free to mark the post as Not Answered and reply. Thank you!

Sunday, March 11, 2012

.Net Reportviewer

plese help me anybody working in .Net report viewer control
how to viewe the report in both Win forms and Webforms
sql server 2005 reporting server
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.comWhat is your question? The best way to approach this is to first learn how
to create reports. Create and deploy the reports to the server. Make sure
you throughly understand creating reports including the use of sub reports
and drill through reports.
VS 2005 comes with two new controls (a winform and webform control). These
are the easiest way to view a report. The other option is either URL
integration (search on Books Online). The final option is to program web
services yourself. With the new controls I strongly recommend against doing
the last option.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<mohan> wrote in message news:2006121355941ragu1100@.yahoo.com...
> plese help me anybody working in .Net report viewer control
> how to viewe the report in both Win forms and Webforms
> sql server 2005 reporting server
> EggHeadCafe.com - .NET Developer Portal of Choice
> http://www.eggheadcafe.com

Thursday, March 8, 2012

.Net interface to vss for sql 2000 stored procedures

We would like to use the version control for sql stored procedures through
.net, however, according to Microsoft's implementation procedures it gives
developers "sa" authority. Does anyone know how we can set this up without
the developers having "sa" authority on our database?You can use Windows Authentication for developers staff
"sgerwie" wrote:

> We would like to use the version control for sql stored procedures through
> .net, however, according to Microsoft's implementation procedures it gives
> developers "sa" authority. Does anyone know how we can set this up without
> the developers having "sa" authority on our database?|||We do use Windows Authentication for the developers, however, in order to se
t
this up, SQL services has to run with "sa" authority and Admin rights on the
server, therefore, it automatically gives everyone "sa" rights to SQL. It
doesn't matter
"MAURICIO" wrote:
[vbcol=seagreen]
> You can use Windows Authentication for developers staff
> "sgerwie" wrote:
>

Thursday, February 16, 2012

**HAVE NULL AND NOT DUBLICATED VALUES IN COL**

Hi
I'm using SQL 2000,how is it possible to control a value of column to get
the ollowing result?
Emp (EmpId PK,EmpName,EmpCode)
EmpId EmpName EmpCode
-- -- --
100 John 3
101 Anne 5
102 Robert null
103 Jennifer null
104 Peter 78
I want to have some NULLs or a unique number in EmpCode column as above,
I tried to define Uniqe index or constraint but it wasn't successfull
because of null,
now how can I prevent of inserting a record of (105,'Tom',3) and not prevent
of inserting a record like (105,'Tom',null)
Any help would be greatly thankful.Here are three possible methods (in each case, Colx is the nullable,
unique column):
1. Use an indexed view:
CREATE VIEW SomeTable_Unique_Non_NULL
WITH SCHEMABINDING
AS
SELECT colx
FROM dbo.SomeTable
WHERE colx IS NOT NULL
GO
CREATE UNIQUE CLUSTERED INDEX uclcolx ON SomeTable_Unique_Non_NULL
(colx)
2. Use an index with a calculated column:
CREATE TABLE SomeTable (keycol INTEGER PRIMARY KEY, colx INTEGER NULL,
foo
AS (CASE WHEN colx IS NULL THEN keycol END), UNIQUE (colx,foo))
3. Use a trigger:
CREATE TRIGGER trg_SomeTable_Unique_Non_NULL
ON SomeTable FOR UPDATE, INSERT
AS
IF EXISTS
(SELECT *
FROM Inserted AS I
JOIN SomeTable AS S
ON I.colx = S.colx AND I.keycol<>S.keycol)
BEGIN
ROLLBACK TRAN
RAISERROR('Duplicate values not permitted',16,1)
END
David Portas
SQL Server MVP
--|||David
I think violation of UNIQUE KEY constraint will terminate the batch , i mean
we will not see the error generated by the trigger.
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1108554393.210913.172600@.z14g2000cwz.googlegroups.com...
> Here are three possible methods (in each case, Colx is the nullable,
> unique column):
> 1. Use an indexed view:
> CREATE VIEW SomeTable_Unique_Non_NULL
> WITH SCHEMABINDING
> AS
> SELECT colx
> FROM dbo.SomeTable
> WHERE colx IS NOT NULL
> GO
> CREATE UNIQUE CLUSTERED INDEX uclcolx ON SomeTable_Unique_Non_NULL
> (colx)
> 2. Use an index with a calculated column:
> CREATE TABLE SomeTable (keycol INTEGER PRIMARY KEY, colx INTEGER NULL,
> foo
> AS (CASE WHEN colx IS NULL THEN keycol END), UNIQUE (colx,foo))
> 3. Use a trigger:
> CREATE TRIGGER trg_SomeTable_Unique_Non_NULL
> ON SomeTable FOR UPDATE, INSERT
> AS
> IF EXISTS
> (SELECT *
> FROM Inserted AS I
> JOIN SomeTable AS S
> ON I.colx = S.colx AND I.keycol<>S.keycol)
> BEGIN
> ROLLBACK TRAN
> RAISERROR('Duplicate values not permitted',16,1)
> END
> --
> David Portas
> SQL Server MVP
> --
>|||I tried sth like below in the past ,but I think it can be dangrous in
sometimes
for example if we have a begin transaction in our statement and the this
trigger
fires and duplicated value was inserted then it will rollback to the poit
which made the other activities which are done before this trigger to be
rollbacked too!!!!!!!
what's your openion?
CREATE TRIGGER trg_SomeTable_Unique_Non_NULLred">
> ON SomeTable FOR UPDATE, INSERT
> AS
> IF EXISTS
> (SELECT *
> FROM Inserted AS I
> JOIN SomeTable AS S
> ON I.colx = S.colx AND I.keycol<>S.keycol)
> BEGIN
> ROLLBACK TRAN
> RAISERROR('Duplicate values not permitted',16,1)
> END
>
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1108554393.210913.172600@.z14g2000cwz.googlegroups.com...
> Here are three possible methods (in each case, Colx is the nullable,
> unique column):
> 1. Use an indexed view:
> CREATE VIEW SomeTable_Unique_Non_NULL
> WITH SCHEMABINDING
> AS
> SELECT colx
> FROM dbo.SomeTable
> WHERE colx IS NOT NULL
> GO
> CREATE UNIQUE CLUSTERED INDEX uclcolx ON SomeTable_Unique_Non_NULL
> (colx)
> 2. Use an index with a calculated column:
> CREATE TABLE SomeTable (keycol INTEGER PRIMARY KEY, colx INTEGER NULL,
> foo
> AS (CASE WHEN colx IS NULL THEN keycol END), UNIQUE (colx,foo))
> 3. Use a trigger:
> CREATE TRIGGER trg_SomeTable_Unique_Non_NULL
> ON SomeTable FOR UPDATE, INSERT
> AS
> IF EXISTS
> (SELECT *
> FROM Inserted AS I
> JOIN SomeTable AS S
> ON I.colx = S.colx AND I.keycol<>S.keycol)
> BEGIN
> ROLLBACK TRAN
> RAISERROR('Duplicate values not permitted',16,1)
> END
> --
> David Portas
> SQL Server MVP
> --
>|||On Thu, 17 Feb 2005 08:47:56 +0330, maryam rezvani wrote:

>I tried sth like below in the past ,but I think it can be dangrous in
>sometimes
>for example if we have a begin transaction in our statement and the this
>trigger
>fires and duplicated value was inserted then it will rollback to the poit
>which made the other activities which are done before this trigger to be
>rollbacked too!!!!!!!
>what's your openion?
Hi Maryam,
Transactions are used to encapsulate a number of statements that should
either be executed as a whole, or none at all.
So if I have several statements and one of them is an insert that fails as
a result of duplicate data, I would expect and want SQL Server to undo all
changes made since the BEGIN TRANSACTION.
If you want to rollback only the insert but none of the preceding
activities, then simply commit the transaction for these other activities
first, before executing the insert.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Thanks,now imagine we don't define any begin trans before and we fire this
trigger and it will fail because of duplicated rows and rollback happen
too,but to which poit ?just to prevet inserting duplicated rows or......?
"Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
news:13o811tiqus3gpgt2glj5tn74sp16utraa@.
4ax.com...
> On Thu, 17 Feb 2005 08:47:56 +0330, maryam rezvani wrote:
>
> Hi Maryam,
> Transactions are used to encapsulate a number of statements that should
> either be executed as a whole, or none at all.
> So if I have several statements and one of them is an insert that fails as
> a result of duplicate data, I would expect and want SQL Server to undo all
> changes made since the BEGIN TRANSACTION.
> If you want to rollback only the insert but none of the preceding
> activities, then simply commit the transaction for these other activities
> first, before executing the insert.
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)|||In that case only the INSERT operation itself will be rolled back.
--
David Portas
SQL Server MVP
--|||Yes, if you define colx as UNIQUE then the trigger will not fire. The
trigger is something you can use instead of a unique constraint.
David Portas
SQL Server MVP
--

Saturday, February 11, 2012

(This site might require the following ActiveX control: ‘Microsoft SQL Server 2000 Reporting Ser

When a user tries to print using client side printing it gives the following error:-

(This site might require the following ActiveX control: ‘Microsoft SQL Server 2000 Reporting Services’ from Microsoft Corporation.’ Click here to install.)

My client machines have ie 6 sp 2 already installed.

Do I need to install anything on my client machines as well? I have over 100 clients ?
Full fidelity printing requires downloading an ActiveX control to the client. You can turn off the print icon if this is not acceptable.|||Hi .

How can i turn off my print icon in report toolbar. i am using sql server 2000.

Thanks in advance,
Sanket.

(This site might require the following ActiveX control: ‘Microsoft SQL Server 2000 Reporting Ser

When a user tries to print using client side printing it gives the following error:-

(This site might require the following ActiveX control: ‘Microsoft SQL Server 2000 Reporting Services’ from Microsoft Corporation.’ Click here to install.)

My client machines have ie 6 sp 2 already installed.

Do I need to install anything on my client machines as well? I have over 100 clients ?
Full fidelity printing requires downloading an ActiveX control to the client. You can turn off the print icon if this is not acceptable.|||Hi .

How can i turn off my print icon in report toolbar. i am using sql server 2000.

Thanks in advance,
Sanket.

(This site might require the following ActiveX control: ‘Microsoft SQL Server 2000 Reporting

When a user tries to print using client side printing it gives the following error:-

(This site might require the following ActiveX control: ‘Microsoft SQL Server 2000 Reporting Services’ from Microsoft Corporation.’ Click here to install.)

My client machines have ie 6 sp 2 already installed.

Do I need to install anything on my client machines as well? I have over 100 clients ?
Full fidelity printing requires downloading an ActiveX control to the client. You can turn off the print icon if this is not acceptable.|||Hi .

How can i turn off my print icon in report toolbar. i am using sql server 2000.

Thanks in advance,
Sanket.