Showing posts with label regarding. Show all posts
Showing posts with label regarding. Show all posts

Tuesday, March 27, 2012

DataTable and autoincremental Database Fields

Hi,

I got a problem regarding autoincremental Database Fields and DataTables. Using the technique to map the DataBase to an *.xsd file and trying to insert a Row into the table always results in this kind of error:

Cannot insert explicit value for identity column in table 'Cars' when IDENTITY_INSERT is set to OFF.

This only happens when I set CarIDs properties AutoIncrement = true, AutoIncrementSeed = -1, AutoIncrementStep = -1. Having AutoIncrement = false, results in this error:

Column 'CarID' does not allow nulls.
Do I missunderstand something, or do I need to change some parts? I would be glad if someone could help me and figure out what I am doing wrong.
Thanks a lot have a nice weekend.
Regards Johannes

Hi,

i figured out something new. Regarding the line in which the error occurs it happens when I am trying to add a new row into the Datatable.

That's my code:

1[System.ComponentModel.DataObjectMethodAttribute2 (System.ComponentModel.DataObjectMethodType.Insert,true)]3public bool InsertCar(int CarType,string CarNumberPlate,string CarMileage,4string CarServiceRange,bool CarSummerTires,bool CarWinterTires,bool CarHitch,5int CarCarageID, Guid CarUserID, DateTime CarPurchased,bool CarSold)6 {7 Fleet.CarsDataTable cars =new Fleet.CarsDataTable();8 Fleet.CarsRow car = cars.NewCarsRow();91011 car.CarType = CarType;12 car.CarNumberPlate = CarNumberPlate;13 car.CarMileage = CarMileage;14 car.CarServiceRange = CarServiceRange;15 car.CarSummerTires = CarSummerTires;16 car.CarWinterTires = CarWinterTires;17 car.CarHitch = CarHitch;18 car.CarGarageID = CarCarageID;19 car.CarUserID = CarUserID;20 car.CarPurchased = CarPurchased;21 car.CarSold = CarSold;2223 cars.AddCarsRow(car);24int rowsAffected = Adapter.Update(cars);2526return rowsAffected == 1;27 }

The error occurs in line 23. Depeding on the settings in my Fleed.xsd file for CarID, as mentioned above the error changes.

Okay tried something else and fixed it. I reconfigured my TableAdapter and activatedRefresh the data table.No it works perfectly. Ig anyone could explain that to me I would be happy.

Thanks a lot.

Regards Johannes

Datasource to AnalysisServices

I have a question regarding creating a datasource that connects to an
Analysis Services Database. (AS and RS are both 2005 editions.)
If I create a (shared) datasource to an Analysis server, and Specify the IP
address (10.200.23.24) of that server, I have no problems.
However, if I want to connect via HTTP, I am having a few problems.
-In the connection properties, I specify the Server Name to the HTTP url
(http://10.200.23.24/OLAP/msmdpump.dll)
-I specify a username and password with permissions to see the cubes and
data.
-I am able to select the database name from the dropdown list. (So,
obviously it is hitting the AS server, and the AS server is sending back the
databases in which I have permission to see.)
-If I select test connection, it initially fails, but if I go to the
advanced options, and remove the SSPI, test connection succeeds.
-Press OK to save the datasource, and run (preview) the report.
When I go to run (preview) the report, I get the following error:
"Non-Windows user credentials were supplied for a non-http connection to
Analysis Services. The Microsoft SQL Server Analysis Services data extension
requires Windows Integrated Security unless connecting via http or https"
I don't understand why I am getting that error when I am connecting via
http. Is there another property somewhere I have to turn on, so that it
knows I am using http?
As a side note, I know the HTTP connection works, as I can connect via HTTP
with both proclarity, and management studio. The problem only seems to be in
reporting services.
Any ideas?
-RyanHello Ryan,
What credetial mode you chose in the shared data source?
And have you follow this article to configure the HTTP access to AS 2005?
Configuring HTTP Access to SQL Server 2005 Analysis Services on Microsoft
Windows Server 2003
http://www.microsoft.com/technet/prodtechnol/sql/2005/httpasws.mspx
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||The credentials are set at "Use a specific username and password".
I have the username of a local machine account on the server, and it's
password.
I've also tried the username in the format of MACHINENAME\UserName. That
didn't work either.
I know the http is set up properly, as I can access the cubes on that server
via HTTP with proclarity, and management studio, so I do not believe that is
the issue.
Does it have anything to do with the fact the report was designed with the
datasource pointing to a direct tcp connection, and then wanting to change
it to HTTP after the fact?
-Ryan
"Wei Lu [MSFT]" <weilu@.online.microsoft.com> wrote in message
news:rvJmMbUNHHA.2300@.TK2MSFTNGHUB02.phx.gbl...
> Hello Ryan,
> What credetial mode you chose in the shared data source?
> And have you follow this article to configure the HTTP access to AS 2005?
> Configuring HTTP Access to SQL Server 2005 Analysis Services on Microsoft
> Windows Server 2003
> http://www.microsoft.com/technet/prodtechnol/sql/2005/httpasws.mspx
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>|||Here's a little bit more information:
The "Type" of the datasource is set as "Microsoft SQL Server Analysis
Services" . This is where I am having the issue where it works fine with tcp
connection, but HTTP connection gives the error.
If I change the type to OLEDB, and build a connection string to connect to
my cubes, when I preview the report, I get no errors.
However, nothing shows up for any of the queries. Warnings that say:
"The data set 'DatasetName' contains a definition for the Field 'FieldName'.
The field is missing from the returned resultset from the datasource."
Followed by:
"The data set 'DatasetName' contains a definition for the Field 'FieldName'.
The data extension returned an error during the reading of the field. THere
is no data for the field at position 5."
Further, I watched the profiler in analysis services, and it looks like the
right queries are being executed.
My questions are:
1. Do I have to use an OLEDB connection to use HTTP?
-If so, how do I get rid of the above errors? (Are they due to the fact
the datasets were designed with the analysis services connection type, then
switched to oledb?)
2. If I can use HTTP on the direct "Microsoft SQL Server Analysis Services"
connection type, is there anything else (advanced properties) that needs to
be set to make it work?
3. Has anyone successfully created a report using TCP on the direct
provider, then tried switching it to HTTP after the report was complete?
Thanks,
-Ryan|||Hello Ryan,
The reason why you could not connect to the Analysis Service Via http in
Reporting Services is because of the credential.
If you have enabled the Integrated Authentication in IIS, you need to use
the domain account. Or you need to specify a same account in the server as
the one you use in the local machine.
Please try this and let me know if this could not resolve your issue.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi ,
How is everything going? Please feel free to let me know if you need any
assistance.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.

Thursday, March 22, 2012

Dataset limitation

I have encountered a really strange error regarding using Unions in my
datasets.
If i exceed the limit of 4 unions in my dataset, it ignores the data for
those 4 unions and only gives me the data from the 5th union and onwards
until it reaches the limit of again 4 unions, i.e. 8 for the second time
around.
Has anyone else encountered this kind of error/ limitation' Any suggestions
are welcome.
Thanks,
NatWhat type is the data source? SQL Server? What happens if you run the same
query in Query Analyzer?
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Nat" <Nat@.discussions.microsoft.com> wrote in message
news:288F50E7-DF2F-408E-B416-1E2C1558487E@.microsoft.com...
>I have encountered a really strange error regarding using Unions in my
> datasets.
> If i exceed the limit of 4 unions in my dataset, it ignores the data for
> those 4 unions and only gives me the data from the 5th union and onwards
> until it reaches the limit of again 4 unions, i.e. 8 for the second time
> around.
> Has anyone else encountered this kind of error/ limitation' Any
> suggestions
> are welcome.
> Thanks,
> Natsql

Friday, February 17, 2012

Database user and Corresponding login

Hi everyone,

I have a simple question regarding the database users on sqlserver 2005.

When i run a 'sp_helpuser' stored procedure in a database to know the usernames and their corresponding loginsName, i find there are some usernames with corresponding loginName as null.I know for sure that for 'Guest' username the corresponding loginName will be Null, but i find many normal database users with Null login names.

Can anyone throw some light on this scenario?.and what about 'dbo' user in a database? can dbo user have a 'NULL' login name or 'sa' login by default?. Please help me

Thanks in advance.

Regards

Arvind L

You can use sp_change_users_login 'Report' to find out if there are orphaned users. (users with no login)

There are users like 'Guest', 'dbo', 'INFORMATION_SCHEMA' that will not have logins associated because these are defined by the system, but if there are users like 'George', etc. then these are most likely users that were created at one time by users or admins. The above command will help you to know which users are orphaned and can be fixed by creating logins and associating them with the user.

When a sysadmin user logs in, they do not necessarily have a user for every database because they can query any database. Those with specific permissions db_datareader or db_datawriter, etc. will need to have a user in the database that they are trying to query because they are limited to permissions assigned.

HTH.

|||

One possible senario is, this database might be restored from another sql server instance and that server may be having these logins-users mapping. Once the database is shifted from one server to another the user-login mapping breaks though the logins are there in the new instance. you need to remap the orphaned user with the logins using sp_change_users_login

Madhu

|||Thanks Ben and Madhu..for the useful piece of info!!!