The Expression Edit That Is Invoked When You Click On The ... Only Allows You To Select Databasedetails As The Object
Jan 4, 2008
I'm trying to do something that should be simple. I want to use a copy database task and make it generic so we can call on it from and application which would pass the database names and file locations.
Any examples or documention would be helpful.
The expression edit that is invoked when you click on the ... only allows you to select databasedetails as the object however databasedetails is a collection and I have several properties in that collection that I need to assign values to via variables. I'm still lost and don't know how to enter the expression so that I can set the properties to the values in the variables. In addition the databasedetials collection has a collection which is the databasefiles collection.
Can you show me how to do this? It really is not clear how to assign the values from the variables to the properties in the collection since the editor does not expose the properties with in the property databasedetails since it is a collection.
so How do you enter and expression to set the properties of databasedetails and databasefiles?
DatabaseDetails.DatabaseName?
DatabaseDetails.DatabaseDestinationName?
DatabaseDetails.DatabaseFiles.0.DestinationFilePath?
DatabaseDetails.DatabaseFile.0.SourceFilePath?
DatabaseDetails.DatabaseFile.0.SourceShareFilePath?
DatabaseDetails.DatabaseFiles.1.DestinationFilePath?
DatabaseDetails.DatabaseFile.1.SourceFilePath?
DatabaseDetails.DatabaseFile.1.SourceShareFilePath?
View 6 Replies
ADVERTISEMENT
May 28, 2007
Hi
Bear with me I am creating my first report using sql server 2005 report wizard.
I have a query that s runs OK and returns name/addresses of companies for me to write a statement report.
My question is , how can only the 'FILLED' address column get displayed onto report and empty address fields are rejected i.e.
Address 1: 12 WoodStock Road
Address 2:
Address 3: Oxford
Address 4:
Address 5: OX10 0AB
therefore the report (page) should only display Address 1, Address 3 and Address 5
I tried to solve by trying to write an expression in 'Edit Experssion' without any joy.
Thanks in advance
View 5 Replies
View Related
Jan 25, 2006
Hi
I have some SSIS variables of type System.Object (they have to be this
type because they are used to hold the results of a single row result
set in an Execute SQL task which is querying an Oracle database.
Although I know the Oracle table columns are Numeric, this was the only
SSIS type that worked).
My problem is that I want to use these variables in expressions, but
can't - I get the error "The data type of variable "User::varObjectVar"
is not supported in an expression".
The only workaround I can think of is to use a script to assign
the numeric values (integers, in fact) that these variables hold to
other variables of type Int32.
Is that my only option, or am I missing something?
thanks
- Jerzy
View 6 Replies
View Related
May 16, 2006
Hi all,
I have a task as creating a SSIS package to transfer all the 10 tables from a database to another. And I have used the Transfer SQL Objects Task to select a table list and let the component do the transfering.
But my problem is that the source database have bad data and some null data, so I have to find a way to transfer only 'NOT BAD' data, and remove the bad data (lost relationship) and change NULL to "N/A".
And I can't find a way to do this. Is there anyone have experiences with this problem?
Can anyone help me?
I will very appreciate you help?
View 1 Replies
View Related
Jan 4, 2008
Hi all,
I copied the following code from a tutorial book and executed it in my SQL Server Management Studio Express (SSMSE):
--CET.sql--
USE AdventureWorks
GO
--Use column value from a table pointed at by a foreign key
WITH ProductItemPrices AS
(
SELECT ProductID, AVG(LineTotal) 'AvgPrice'
FROM Sales.SalesOrderDetail
GROUP BY ProductID
)
SELECT p.Name, pp.AvgPrice
FROM ProductItemPrices pp
JOIN
Production.Product p
ON
pp.ProductID = p.ProductID
ORDER BY p.Name
SELECT * FROM ProductItemPrices
GO
--Display rows from SalesOrderDetail table with a LineTotal
--value greater than the average for all Linetotal values with
--the same ProductID value
WITH ProductItemPrices AS
(
SELECT ProductID, AVG(LineTotal) 'AvgPrice'
FROM Sales.SalesOrderDetail
GROUP BY ProductID
)
SELECT TOP 29 sd.SalesOrderID, sd.ProductID, sd.LineTotal, pp.AvgPrice
FROM Sales.SalesOrderDetail sd
JOIN
ProductItemPrices pp
ON pp.ProductID = sd.ProductID
WHERE sd.LineTotal > pp.AvgPrice
ORDER BY sd.SalesOrderID, sd.ProductID
--Return EmployeeID along with first and last name of employees
--not reporting to any other employee
SELECT e.EmployeeID, c.FirstName, c.LastName
JOIN HumanResources.Employee e
ON e.ContactID = c.ContactID
JOIN HumanResources.EmployeeDepartmentHistory d
ON d.EmployeeID = e.EmployeeID
JOIN HumanResources.Department dn
ON dn.DepartmentID = d.DepartmentID)
JOIN Empcte a
ON e.ManagerID = a.empid)
--Order and display result set from CTE
SELECT * Hi all,
I copied the following T-SQL code from a tutorial book and executed it in my SQL Server Management Studio Express (SSMSE):
--CTE.sql--
USE AdventureWorks
GO
--Use column value from a table pointed at by a foreign key
WITH ProductItemPrices AS
(
SELECT ProductID, AVG(LineTotal) 'AvgPrice'
FROM Sales.SalesOrderDetail
GROUP BY ProductID
)
SELECT p.Name, pp.AvgPrice
FROM ProductItemPrices pp
JOIN
Production.Product p
ON
pp.ProductID = p.ProductID
ORDER BY p.Name
SELECT * FROM ProductItemPrices
GO
--Display rows from SalesOrderDetail table with a LineTotal
--value greater than the average for all Linetotal values with
--the same ProductID value
WITH ProductItemPrices AS
(
SELECT ProductID, AVG(LineTotal) 'AvgPrice'
FROM Sales.SalesOrderDetail
GROUP BY ProductID
)
SELECT TOP 29 sd.SalesOrderID, sd.ProductID, sd.LineTotal, pp.AvgPrice
FROM Sales.SalesOrderDetail sd
JOIN
ProductItemPrices pp
ON pp.ProductID = sd.ProductID
WHERE sd.LineTotal > pp.AvgPrice
ORDER BY sd.SalesOrderID, sd.ProductID
--Return EmployeeID along with first and last name of employees
--not reporting to any other employee
SELECT e.EmployeeID, c.FirstName, c.LastName
FROM HumanResources.Employee e
JOIN Person.Contact c
ON e.ContactID = c.ContactID
where ManagerID IS NULL
--Specify top level EmployeeID for direct reports
DECLARE @TopEmp as int
SET @TopEmp = 109;
--Names and departments for direct reports to
--EmployeeID = @TopEmp; calculate employee name
WITH Empcte(empid, empname, mgrid, dName, lvl)
AS
(
-- Anchor row
SELECT e.EmployeeID,
REPLACE(c.FirstName + ' ' + ISNULL(c.MiddleName, '') +
' ' + c.LastName, ' ', ' ') 'Employee name',
e.ManagerID, dn.Name, 0
FROM Person.Contact c
JOIN HumanResources.Employee e
ON e.ContactID = c.ContactID
JOIN HumanResources.EmployeeDepartmentHistory d
ON d.EmployeeID = e.EmployeeID
JOIN HumanResources.Department dn
ON dn.DepartmentID = d.DepartmentID
WHERE e.EmployeeID = @TopEmp
UNION ALL
-- Recursive rows
SELECT e.EmployeeID,
REPLACE(c.FirstName + ' ' + ISNULL(c.MiddleName, '') +
' ' + c.LastName, ' ', ' ') 'Employee name',
e.ManagerID, dn.Name, a.lvl+1
FROM (Person.Contact c
JOIN HumanResources.Employee e
ON e.ContactID = c.ContactID
JOIN HumanResources.EmployeeDepartmentHistory d
ON d.EmployeeID = e.EmployeeID
JOIN HumanResources.Department dn
ON dn.DepartmentID = d.DepartmentID)
JOIN Empcte a
ON e.ManagerID = a.empid)
--Order and display result set from CTE
SELECT *
FROM Empcte
WHERE lvl <= 1
ORDER BY lvl, mgrid, empid
--Alternate statement using MAXRECURSION;
--must position immediately after Empcte to work
SELECT *
FROM Empcte
OPTION (MAXRECURSION 1)
====================================
This is Part 1 (due to the length of input > 50000 characters).
Scott Chang
View 5 Replies
View Related
Mar 27, 2006
I have created a sql login account called "webuser" and has given public role in my database. In my asp.net application i build connection string using above account and its password . We give permission on store procedure for for the above account to execute .We dont give table level permission for the above account . When we run the application with the above settings it runs fine on test server . However Now i have transfered the databse object to live server with its permissions . Now while I executing the aspx page , I am getting above error . I have checked that the store procedure has execute permission for webuser account and dbo(i.e SA) has all the permissions for all database objects . Still why i am getting error ? (Please note , the thing is working fine in test server)
Pl help
Regards
View 4 Replies
View Related
Oct 16, 2006
The following objects are placed on the Report body of the Report pane of SQL Server 2005 Reporting Services :
<textbox: expression1>
<textbox: expression2>
<table:table1 with at least 30 columns and 30 expressions>
<textbox: string1> - considered as the Title in the Footer section of the report
<texbox:string2> <textbox:expression3>
<textbox:string3> <textbox:expression4>
<textbox:string4> <textbox:expression5>
<textbox:expression6>
I can't find any explanation why is it string1 and string 2 of the footer section of my report displayed separately from the expression3 which is aligned on it and the rest of the object on the second page.
The expected design is that all Footer items should be displayed together of whether it is placed on the first page or on the last page.
As a workaround of this, I converted string 1 into an expression (Added = and enclosed the string with double quote).. As a result, all of the items in the Footer section are now placed together on the last page of the report.
I also remember one of the issue I encountered before where the Footer items where placed together on the first page and still have space at the bottom of the page, but then expression 6 is forced to display (alone) on the last page of my report.
I can't find any discussion related to this, I wish somebody could give me an idea why RS behaved like this.
Thanks in advance
View 1 Replies
View Related
Feb 2, 2014
The full error is this: Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
My Code:
SELECT Customers.CustomerID, Customers.EmailAddress, Customers.LastName, Customers.FirstName,
(SELECT Addresses.Line1, Addresses.Line2, Addresses.City, Addresses.State, Addresses.ZipCode FROM Addresses JOIN Customers
ON Addresses.CustomerID = Customers.CustomerID WHERE Addresses.AddressID = Customers.BillingAddressID),
(SELECT Addresses.Line1, Addresses.Line2, Addresses.City, Addresses.State, Addresses.ZipCode FROM Addresses JOIN Customers
ON Addresses.CustomerID = Customers.CustomerID WHERE Addresses.AddressID = Customers.ShippingAddressID)
FROM Customers JOIN Addresses
ON Customers.CustomerID = Addresses.CustomerID;
I am trying to test a query I am going to use to create a view with all of a customers addresses (billing and shipping).
View 5 Replies
View Related
Apr 24, 2006
Hi,I'm not a big friend of MSSQL, but I have to do one query I've done formySQL.But I don't know how...I have to select 'user' from 'db' where first letter is E or N, second is Bor 0 and after that there are 6 or 7 digits I know.How can I do that?In mySQL it would be something like:SELECT * FROM `table` WHERE `account` regexp '^[EN][B0]123456$' ORDER BY`Id`;Thanks in advance,Martin
View 10 Replies
View Related
May 11, 2007
Hi,
I'm executing the following Query :
SELECT FC3.Quarter, FC3.Service, FC3.TOTALIS, FC2.Quarter AS Expr1, FC2.Service AS Expr2, FC2.FCtIS,
cast((FC2.FCtIS / FC3.TOTALIS) as decimal(4,2)) as Value, getdate() as DateUpdate
--INTO FC4
FROM FC3 LEFT OUTER JOIN
FC2 ON FC3.Quarter = FC2.Quarter AND FC3.Service = FC2.Service
result:
Quarter Service TotalIS Quarter Service FCtIS Value DateUpdate
2007Qt1 Executive contracts 210 2007Qt1 Executive contracts 166 0.00 2007-05-11 15:23:08.100
My problem is that ' canīt get a decimal Value on the VALUE column ....
If i don't use the cast function i get a 0 , forcing a decimal value with cast i get 0.00 ..
This column is intended to retrieve a percentage , like 0,5(50%) ; 0,45 (45%), what is happening ?
View 4 Replies
View Related
Sep 13, 2001
can anyone tell me what would casuse this error:
2001-09-12 21:21:01.11 kernel udopen: Operating system error 32(The process cannot access the file because it is being used by another process.) during the creation/opening of physical device C:MSSQL7dataReporting.mdf.
2001-09-12 21:21:01.11 kernel FCB::Open failed: Could not open device C:MSSQL7dataReporting.mdf for virtual device number (VDN) 1.
What other things would cause the Reporting.mdf to be locked so the SQL server could not open it?
View 2 Replies
View Related
May 6, 2004
Hi,
When I invoke a session in SQL Server I would to create few temp tables. I have got the queries in a file. Is there any way to invoke these queries (Creating Temp tables) whenever I invoke a session.
Any suggestion/guidence would be greatefully received.
Regards,
SAM
View 2 Replies
View Related
Jul 23, 2005
Hey everyone --I've been having this problem for a couple weeks and was hoping maybesomeone can help out a little bit.Synopsis:This SQL agent job contains code to perform a full database backup withverification and is writing to a local disk array. I typically also usesome code for reporting - declaring variables and inserting them intoa linked server database that I use to monitor all my database backups.I have tested and used the code repeatedly and am confident it works.I have ran the code through Query Analyzer and it completes withsuccess.I have removed reporting code & used only the backup statement & itfails.I have 4 other Agent jobs doing other various tasks that function asexpected.I have tried deleting & recreating the job & it still fails.When I enable logging the application log has only one entry for SQLAgent:Event Type:WarningEvent Source:SQLSERVERAGENTEvent Category:Job EngineEvent ID:208Date:1/4/2005Time:9:36:00 AMUser:N/AComputer:ComputerNameDescription:SQL Server Scheduled Job 'DBName Full DB Backup'(0xA4B14FB5A5DE964B8340423E4AC4B67B) - Status: Failed - Invoked on:2005-01-04 09:36:00 - Message: The job failed. The Job was invoked byUser domainUserName. The last step to run was step 1 (Step 1).Any help or ideas would be greatly appreciated. I'm racking my brainhere and for some reason just not able to think of what the problem is.ChaddJoin Bytes!
View 9 Replies
View Related
Apr 24, 2007
I have a rectangle region in a report that contains a graph and a table. I want to display that list region only when the user selects a "Select All" from a multi-select report parameter. This rectangle region is used only to display summary data for All Agencies.
My report also contains a list region with graphs and tables, where I display data for each agency (my detail group), and page-break on each agency.
The problem I am experiencing occurs when using the Expression Builder for the Visibility property for my rectangle and list regions. Since a multi-select parameter is an array, I am forced to select an element in my paramater such as =Parameters!Agency.Value(0). When the user chooses "(Select All)", the first element is the first agency in the list. I don't want that.
How can I get Reporting Services to display a rectangle or list region when "Select All" is chosen, and to hide that rectangle or list region when one or more agencies are chosen from a multi-select parameter?
I have tried using Agency.Label and I've tried other expressions such as Parameters!Agency.Count = Count(Agency.Value), etc, without success.
View 4 Replies
View Related
Nov 11, 2014
I am using sql server 2008 version and invoking the stored procedure using unix script. I want to know the procedure of killing the stored procedure in sql server.
If I kill -9 the unix script will it also terminate the process at the SQL server. When I executed the kill -9 PID in unix and ran the command exec sp_who2 it showed me only one sessionid and status as runnable - which means waiting for resources. BUt I am not sure whether it was the one which was triggered through unix.
My SP is executing in loop thereby is there any way I can avoid going into infinite loop?
View 3 Replies
View Related
Jan 16, 2008
Hi. I was wondering if there is such thing in MSSQL 2005? Not the one in SSIS.
Any feedback will be greatly appreciated.
Thanks,
Rick..
View 11 Replies
View Related
Jan 15, 2008
Hello, the following code works perfectly in SQL Server 2000 and SQL Server 2005 Express over WinXP but when run against an instance of SL Server2005 Express over Win2003Server, the first time Command.Execute is invoked returns no error (even though no action seems to be take by the server), subsequent calls return the error -2147217900 couldn't find prepared instruction with identifer -1 (message may vary, it is a translation from may locale)
Any ideas?
Thanks
Code Block
Public Sub Insert_Alarm(sIP As String, nAlarm As Long)
Static cmdInsert As ADODB.Command
Static Initialized As Boolean
On Error GoTo ErrorHndl
If Not Initialized Then
Set cmdInsert = New ADODB.Command
Set cmdInsert.ActiveConnection = db
cmdInsert.Parameters.Append cmdInsert.CreateParameter("IP", adVarChar, adParamInput, Len(sIP), sIP)
cmdInsert.Parameters.Append cmdInsert.CreateParameter("Alarm", adInteger, adParamInput, , nAlarm)
cmdInsert.CommandText = "insert into ALARMS(date_time,ip,alarm,status) values (getdate(),?,?,1)"
cmdInsert.CommandType = adCmdText
cmdInsert.Prepared = True
Initialized = True
End If
cmdInsert.Parameters(0).value = sIP
cmdInsert.Parameters(1).value = nAlarm
cmdInsert.Execute
Exit Sub
ErrorHndl:
...
End Sub
View 4 Replies
View Related
Aug 12, 2012
An error is entered into the table, across two tables - tblErrors_ER and tblPolicyNumbers_ER - each error generates a PK (ErrorID) and can have any number of policy numbers which will be referenced by its own PK but linked to each error by its FK (ErrorID).I want to display each error in a Gridview in ASP.Net - columns included will be ErrorID, ErrorType, DateLogged from tblErrors_ER and PolicyNumber from tblPolicyNumbers_ER.If an Error has more than one policy number I only want to show the error once in the GridView with the word MULTIPLE under policy number.
tblErrors_ER
---------------
CREATE TABLE tblErrors_ER
{
ErrorID int,
ErrorType varchar(255),
DateLogged datetime,
[code]...
I have changed the Count(*) to Count(tblPolicyNumbers_ER.POlicyNUmber) which gives me the same undesired result as above. I have also left it as Count(*) and the entire CASE expression within the GROUP BY statement as suggest above which generated an error saying I can not use an expression in a group by clause.
If I leave Count(*) = 1 where it is in the original SELECT statement but swap the = for > then something happens, close to what I require but not as intended. It returns:
ErrorID ErrorType DateLogged PolicyNumber
---------------------------------------------------------------
1 Test 08/08/2012 Multiple
2 Test 08/08/2012 Multiple
this would suggest the original syntax is close to being accurate but I can not get it to work.
View 2 Replies
View Related
Jul 16, 2014
I have a cluster using Always on on 2012 and i have set up a Witness file share which losts connectivity the other day and a failover was invoked.
Is there a threshold i can change so that the cluster can try a couple of more times to connect before it fails over ?
View 3 Replies
View Related
Nov 7, 2007
Hi,
When i try to save my stored procedure.. i am getting the above error and this is my sproc
1 INSERT INTO Statement..ClientSources
2 (
3 ClientId,
4 ClientSourceId,
5 SourceName
6 )
7 Select Distinct
8 @ClientId,
9 SOURCE_NUM,
10 (Select CASE s.SOURCE_NUMWhen 1 Then SRC1NAME
11 WHEN 2 Then SRC2NAME
12 WHEN 3 THEN SRC3NAME
13 WHEN 4 THEN SRC4NAME
14 WHEN 5 THEN SRC5NAME
15 WHEN 6 THEN SRC6NAME
16 WHEN 7 THEN SRC7NAME
17 WHEN 8 THEN SRC8NAME
18 WHEN 9 THEN SRC9NAME
19 WHEN 10 THEN SRC10NAME
20 WHEN 11 THEN SRC11NAME
21 WHEN 12 THEN SRC12NAME
22 WHEN 13 THEN SRC13NAME
23 WHEN 14 THEN SRC14NAME
24 WHEN 15 THEN SRC15NAME
25 END
26 FROM
27 PlanDBF p
28 Where
29 p.PLAN_NUM = s.PLAN_NUM
30 ) as SourceName
31 FROM
32 SourceDBF s
33 Where
34 SOURCE_NUM NOT IN (
35 SELECT DISTINCT
36 ClientSourceId
37 --SourceName
38 FROM
39 Statement..ClientSources
40 Where
41 ClientId = @ClientId
42 )
I am getting the error in Line number 35 .. the inserts works fine... and if use * instead of the field name or use more than 1 field name i get this error
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
Any help will be appreciated.
Regards
Karen
View 4 Replies
View Related
Apr 28, 2015
I am getting error [[Msg 116, Level 16, State 1, Line 7 .Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.]] for the below script.
==============================================
Declare @mSql2 Nvarchar(max)
SET @mSql2= (select * from Tablename)
================================================
View 2 Replies
View Related
Nov 18, 2005
I'm trying to set up Service Broker Services on SQL 2005 x86. I've got two services set up, and a stored procedure associated with one of them.
View 3 Replies
View Related
Mar 26, 2005
Hello guys,
Been trying out to use SQL server, so got a copy of SQL Server 2000 on windows xp pro, rather old it seems but the only version I can get my hands on.
However, I just couldn't get it to work in a simple datagrid. The error message:
SELECT permission denied on object 'classList', database 'ck', owner 'dbo'.
Code on asp.net page:
SqlConnection1.Open()
DataGrid1.DataSource = SqlCommand1.ExecuteReader
DataGrid1.DataBind() 'Put user code to initialize the page here
SqlConnection1.Close()
Dim a As SqlCommand
a.ExecuteReader()
I have already added a localhost server (windows NT) under SQL server group, added localhost/ASPNETas a user for my imported database from access, granted SELECT Permission to the database and all tables, any idea what may be wrong with my configuration. I know it's pretty hard to pinpoint the exact problem since it's on my computer, but I have been clicking around and allowing everything on SQL for a few hours, but nothing good. So please any suggestions? Thanx
View 2 Replies
View Related
Mar 22, 2001
Does any body have this problem? when I execut the store procedure in database A that select from a table in database B. I got error
message "SELECT permission denied on object", I know that if I have the permission to execute the store procedure, I don't need the select permission to table. Is is a bug in SQL 7.0 version or what? In SQL 6.5, as long as we have execute permission to Store procedure it will work.
View 3 Replies
View Related
Nov 9, 2000
I have a database owned by the sa. In the database are some tables owned by id1. When I login via SQL Analyzer as id1 and try to select from
the tables owned by id1, I get an error message 208 that the object does not exist. If I query 'select * from id1.table', I get my data. I thought that
if I owned the table I could always access it. Additional facts, id1 is defined as a login, id1 is defined as a user for the database with db_owner role.
Any ideas?
Thanks,
Jen
View 2 Replies
View Related
Mar 24, 2000
I know there must be something i'm missing. I'm logged on as sa on the Query Analyzer, and run a simple select statement, or any statement for that matter, and i get an 'INVALID OBJECT NAME' error.
View 5 Replies
View Related
Feb 7, 2006
Hi,
I'm trying to upgrade my SQL 2000 to 2005 and use it with a web site. I've copied the DB from a SQL 2000 server machine to a 2005 machine, attached the DB to the SQL server using the relative function in Management Studio, but I still continue to get the same error:
[Microsoft][SQL Native Client][SQL Server]SELECT permission denied on object 'Users', database 'YouPlayIt', schema 'dbo'.
using this query: SELECT UserId FROM USERS.
Querying the DB from an ASP page with the query "SELECT CURRENT_USER", the system return the expected value: NKNLEPETD0IUSR_NKNLEPETD0
In SQL server, I've created a user with this name (taking it from the users list), and granted full access to all the tables of the DB.
In the permission Tab of the USERS table the NKNLEPETD0IUSR_NKNLEPETD0 have all the grant checked.
Which other permission do I have to specify in order to have access to the data ???
Thank you,
Nicola Lepetit.
www.youplay.it
View 25 Replies
View Related
Oct 30, 2006
I am using VB 2005 express edition with sql express 2005. I did it this little application that select data from a table. Everything Ok on local but if I use it over lan (it is a workgroup) I obtain this error:
SELECT permission denied on object 'Consensi' on database 'C:dbmarcoplate_dati.mdf' with schema 'dbo'
I used SQL Server Management Studio Express to give all permissions to the user for the Plate_Dati database but nothing changed
this is the program:
Imports System.Data.SqlClient
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Stringa As String = "Data Source=TAPFWSQLEXPRESS;Initial Catalog=c:dbmarcoplate_dati.mdf;
Integrated Security=SSPI;"
Dim cnn1 As New System.Data.SqlClient.SqlConnection(Stringa)
Try
cnn1.Open()
MessageBox.Show("Connection opened")
Dim sqlQuery As String = "SELECT Targa FROM Consensi WHERE Targa = 'AJ385SW'"
Dim cmd1 As New SqlCommand(sqlQuery, cnn1
Dim rdr1 As SqlDataReader
rdr1 = cmd1.ExecuteReader()
Try
Do While rdr1.Read()
MessageBox.Show(rdr1.GetString(0))
Loop
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
rdr1.Close()
End Try
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
cnn1.Close()
MessageBox.Show("Connection closed")
End Try
End Sub
End Class
Please help me I don't know what to do
Thank You
View 4 Replies
View Related
Jun 22, 2006
Hello all,
I have just begun to develop a simple web application to maintain phone book / contact details of people. I have been facing problems wrt the connection to the database, while trying to execute the reader it throws this error -
Server Error in '/phonebook' Application.
SELECT permission denied on object 'PhoneBook', database 'Northwind', owner 'dbo'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: SELECT permission denied on object 'PhoneBook', database 'Northwind', owner 'dbo'.
Error occurs at - reader = cmd.ExecuteReader();
The stacktrace looks like this -[SqlException: SELECT permission denied on object 'PhoneBook', database 'Northwind', owner 'dbo'.] System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742 System.Data.SqlClient.SqlCommand.ExecuteReader() +42 Phonebook.ResultPage.CreateDataSource() in c:inetpubwwwrootphonebook
esultpage.aspx.cs:56 Phonebook.ResultPage.Page_Load(Object sender, EventArgs e) in c:inetpubwwwrootphonebook
esultpage.aspx.cs:39 System.Web.UI.Control.OnLoad(EventArgs e) +67 System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
I have tried managing permissions both on IIS as well as Enterprise Manager and given all rights to the admin. Please help me out
Thanks
Sanchita
View 10 Replies
View Related
Mar 28, 2007
Hi all,
I know this error (below) has been presented before, but I have tried the typical solutions without any luck. The solutions I have tried involve insuring cross-database ownership is enabled. We have run the following query, without any luck with fixing the error.
Is it possible we have something wrong with the tempdb, or modeldb? All the settings appear to be normal (dbo public access). Any ideas would be appreciative.
Thanks,
Oun
To reconfigure SQL 2000 SP3 for ASP.net session state you must runuse master
go
EXEC sp_configure 'Cross DB Ownership Chaining', '0';
RECONFIGURE
GO
View 4 Replies
View Related
Oct 12, 2007
Hi all,
I have my asp.net application with crystal reports which is using OLE DB connection , when I published the application on my test server every thing was ok and I was able to view,print and exprot my reprot (test server is not a domain controller), BUT when I published the application on the production server which is a domain controller it is giving me this error:
Failed to open a rowset. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: The SELECT permission was denied on the object 'MyTable', database 'MyDatabase', schema 'dbo'. SQL State: 42000 Native Error: Failed to open a rowset. Error in File C:WINDOWSTEMPMyreport {C4BCF4E0-469D-4425-8556-A3D2A17059B8}.rpt: Failed to open a rowset
I tried to give the IIS user all the permisions on the database, no result
I tried also to make the authentication mode in IIS to Integrated windows authentication (Disable the user IISER_---) but it still give me the same error
Please help, any help will be highly appreciated
View 7 Replies
View Related
Jul 10, 2004
First off - complete newbie using MSDN.
Getting the error message
System.Data.SqlClient.SqlException: SELECT permission denied on object 'mytable', database 'master', owner 'dbo'. at System.Data.SqlClient.SqlCommand.ExecuteReader...
1. After a lot of googling I've done the following:
EXEC sp_grantlogin 'MYMACHINEASPNET' to grant the ASPNET logon access to the DB
2. Changed the
HKEY_LOCAL_MACHINESOFTWAREMicrosoftMSSQLServerMSSQLServerLoginMode
to 2 to allow mixed mode.
3. using my connection string in web.config - have experimented with different strings with/without trusted_connection and the sa uname and pwd.
(Current connection string is
"server=localhost;Integrated Security=SSPI;Database=master;Data Source=MYCOMPUTERNAME;trusted_Connection=yes"
I'm NOT using SQL Server so what commands do i need to give my db/table SELECT permissions? (and who am I giving permission to - very confused)
I had no bother accessing the server and DB from a simple C# command line program.
Been pulling my hair out for many hours now... any help would be greatly appreciated!
View 1 Replies
View Related
Jul 10, 2004
(Not having a great day - didn't mean to lock that last post - apologies)
First off - complete newbie using MSDN.
Getting the error message
System.Data.SqlClient.SqlException: SELECT permission denied on object 'mytable', database 'master', owner 'dbo'. at System.Data.SqlClient.SqlCommand.ExecuteReader...
1. After a lot of googling I've done the following:
EXEC sp_grantlogin 'MYMACHINEASPNET' to grant the ASPNET logon access to the DB
2. Changed the
HKEY_LOCAL_MACHINESOFTWAREMicrosoftMSSQLServerMSSQLServerLoginMode
to 2 to allow mixed mode.
3. using my connection string in web.config - have experimented with different strings with/without trusted_connection and the sa uname and pwd.
(Current connection string is
"server=localhost;Integrated Security=SSPI;Database=master;Data Source=MYCOMPUTERNAME;trusted_Connection=yes"
I'm NOT using SQL Server so what commands do i need to give my db/table SELECT permissions? (and who am I giving permission to - very confused)
I had no bother accessing the server and DB from a simple C# command line program.
Been pulling my hair out for many hours now... any help would be greatly appreciated!
View 5 Replies
View Related