Differences: Grant, Deny, Revoke
Hello,
I would like to know the differences: Grant, Deny, Revoke
Tks in advance
View Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
DENY Or REVOKE Rights To PUBLIC And GUEST
Hi Guys, We are using MS SQL 2005. I am ask to remove the PUBLIC rights to the objects listed in the following query in the master DB: SELECT sysusers.name, sysobjects.name,sysprotects.action FROM sysobjects, sysusers, sysprotects WHERE sysobjects.id = sysprotects.id AND sysprotects.uid = sysusers.uid AND sysprotects.protecttype = 205 I keep having the "Cannot find the object [Objectname], because it does not exists or you do not have permission." How do I create a query to remove the PUBLIC rights at a single run. (There are total of 1660 items, please dun ask me to write the DENY or REVOKE statement 1660 time ) How do I DENY the rights for objects starting with the prefix "dm_" or items like "TABLE PRIVILEGES" Thanks guys Any help on this is greatly appreciated.
View Replies !
View Related
GRANT SELECT ON [dbo].[TblAreaCatmap] TO [admin] Prevent Grant From Being Automaticly Add To Each Column
GRANT SELECT ON [dbo].[TblAreaCatmap] TO [admin] prevent grant from being automaticly add to each column? Is there a way when you issue a grant select to a table or a view to not also grant select for each column. The problem is when you use the grant command it automaticly adds the grant command to each column. I want to grant the permission at the table level so when the table is scripted it only has a single grant command instead of a grant for the table and a grant for each column which is not needed. The sql managemnt studion interface will allow you to do this but onlt by using the interface. If you issue the above command from a query window it also creates A GRANT FOR EVERY COLUMN. How can I stop this behavior.
View Replies !
View Related
Revoke Permissions TO Stored Procedure
I have written an stored proc that reads from a text file and executesthe script as dynamic sql.If the text file contains malicious code,I want to be able to detect itand prevent the stored procedure from executing.I've tried revoking delete,insert,update rights all tables in thedatabase to the user .I then granted execute rights to the stored procedure for the sameuser. But the user is still able to delete a record from the table byexecuting the stored procedure.Is there any means to I revoke,insert,delete ,update rights to a storedproc?
View Replies !
View Related
Revoke Connect Guest User
I've used the following: EXEC sp_MSforeachdb 'USE [?]; REVOKE CONNECT FROM GUEST;' GO And this is what I get: Msg 15182, Level 16, State 1, Line 2 Cannot disable access to the guest user in master or tempdb. Msg 15182, Level 16, State 1, Line 2 Cannot disable access to the guest user in master or tempdb. Msg 15151, Level 16, State 1, Line 2 Cannot find the user 'GUEST', because it does not exist or you do not have permission. Msg 15151, Level 16, State 1, Line 2 Cannot find the user 'GUEST', because it does not exist or you do not have permission. Msg 15151, Level 16, State 1, Line 2 Cannot find the user 'GUEST', because it does not exist or you do not have permission. When I do this: EXEC sp_MSforeachdb 'USE [?]; SELECT ''[?]'' AS DBName,* FROM sysusers;' GO The guest sid for all tables shows 0x00, is this the reason I get above errors?
View Replies !
View Related
Schema Revoke SELECT Permission
HI, I have set up a database with 5 users, USER1 has default schema USER1, USER2 has default schema USER2 and so on. My problem is that I want to revoke select permission on schema USER1 to user USER2. I issued the following TSQL in SSMS: REVOKE SELECT ON SCHEMA::USER1 to USER2 Even though I did that, I can still log on as USER2 and be able to issue SELECT statements on USER1 schema tables. The only way I can do to avoid the SELECT on USER1 schema is to DENY select on USER1 schema. Is it normal? Thank you for your help, Ccote
View Replies !
View Related
Trouble With Cursor Designed To Revoke Object Access.
Hi everyone. I am having difficulties with a cursor that I am trying to write. The purpose of the cursor is to loop through all tables in a selected Database and revoke "Select" access to that table for the indicated role (RoleToRevoke). I am getting the error on the @name variable within the REVOKE statement. I have placed a comment indicating where I am getting the error. Is there a way to have sql server interpret this @name variable within the REVOKE statement? Thanks for your help. Code Snippet USE [Database_Name]; Declare cursorExample Cursor for Select TABLE_NAME from information_schema.tables Where TABLE_TYPE='Base Table' and TABLE_SCHEMA='dbo' Declare @name as varchar(255) Declare @ErrorSave as int Declare @ErrorCount as int Open cursorExample Fetch Next from cursorExample into @name SET @ErrorSave = 0 SET @ErrorCount = 0 Begin Tran While @@Fetch_Status=0 Begin --Getting Error on Line below on @name REVOKE SELECT ON OBJECT::@name FROM RoletoRevoke; IF (@@ERROR <> 0) BEGIN Print 'Error Revoking Access to Table: ' + CAST(@name AS varchar(75)) SELECT @ErrorCount = @ErrorCount + 1 END IF (@@ERROR = 0) BEGIN Print 'Successful Revoking Select Rights on Table: ' + CAST(@name AS varchar(75)) SELECT @ErrorSave = @ErrorSave + 1 END Fetch Next from cursorExample into @name End IF @ErrorCount = 0 BEGIN COMMIT TRAN PRINT 'COMMITTED TRANSACTION' PRINT 'Total Tables Affected:' + CAST(@ErrorSave AS varchar(75)) END ELSE BEGIN ROLLBACK TRAN PRINT 'ROLLED BACK TRANSACTION' END Close cursorExample Deallocate cursorExample GO
View Replies !
View Related
6.5 Question - Unable To Revoke SA Permission From Local Admin Group
We have a SQL Server 6.5 instance that has yet to be upgraded to SQL 2000. (Long story). Anyhow, I'm trying to revoke SA permission from the local administrators group, which SQL Server grants by default during setup. I followed the instructions on BOL, but no luck. Here is what I've tried. Changed my desktop client from named pipes to TCP/IP Verified the server client allows TCP/IP and named pipes (needed for old applications) Changed security mode to Mixed Created a local group called DBA_Admin Granted DBA_Admin SA permission through SQL Security Manager Revoked SA permission from Administrators group (local admin group on server) Added my domain group to DBA_Admin Unfortunately someone who is a member of the local administrators group, but not DBA_Admin group, is able to still access the SQL Server instance from Enterprise Manager using a trusted connection. Why??????????? Thanks, Dave
View Replies !
View Related
Deny Access
Hello, I Have created a folder in the IIS called Webreporting. I used sql server to generate HTML into that folder. I make NT security to that folder so certain people can view the report. Unfortunatelly my code to generate the scheduled HTML report failed and gave this error message: Server: Msg 16821, Level 11, State 1, Procedure sp_makewebtask, Line 125 SQL Web Assistant: Could not open the output file.
View Replies !
View Related
Deny Permissions
I have a customers table and a stored procedure for deleting records from this table. I connect to sql using a connection string with sql server authentication using a user I've set up in sql server. This user has roles public, db_datareader and db_datawriter and has permissions to execute all my custom stored procedures. Up to this point everything is fine and I can insert, update and delete. Happy days. If I then select the permissions for the user and deny delete permission on the customers table I thought that because deny overrides everything else I could not delete a customer from my application. Much to my surprise, I can. Why is this?
View Replies !
View Related
DENY DELETE
Hello, Is is possible to Grant a 'DENY DELETE' on a table to the 'sa'user or will the fact that he is administrator over ride the restriction. Thanks Fred Scuttle
View Replies !
View Related
How To Deny DMV To Public?
Hi Guys, I am unable to deny DMV rights to public. I have already ran the SQL query successfully: "DENY VIEW SERVER STATE TO public" and "DENY VIEW DATABASE STATE TO public" However when I check my master DB, the public still have rights to all the dm_***** objects. Am I doing it wrong or is there any steps I missed out? Can anyone help please? Thanks a million.
View Replies !
View Related
DENY CONNECT SQL TO
Hello All, I want to deny all user connections to be denied to a Database cluster. How best to do it? As per my research I can use DENY CONNECT SQL TO instead of sp_denylogin but how can I deny login to say NORTHWIND database? Also To kill all the connections to the database will the following command work best or should I use something else? SELECT 'KILL' + CAST(spid AS nvarchar(10)) FROM SYSPROCESSES Thanks
View Replies !
View Related
Deny An Application?
Hello everyone, Is there a way to deny a specific application from connecting to SQL Server? There is an application some of my developers use that connects with Windows Authentication that I would like to block from my production server. I can't deny the user's logins because they need to be able to connect to the server from other applications. Does anyone have any suggestions? Thanks in advance, Jarret
View Replies !
View Related
EXECUTE Permission Deny
Any one can help me, below error messages for reference, thanks! Exception Details: System.Data.SqlClient.SqlException: EXECUTE permission denied on object 'sp_insertspend', database 'master', owner 'dbo'.Source Error: Line 96: cmdMid.Connection = conMid; Line 97: cmdMid.CommandText = "exec sp_insertspend '" + uid + "','" + Mid + "','" + status + "','" + spend + "'"; Line 98: cmdMid.ExecuteNonQuery(); Line 99: conMid.Close(); Line 100:Source File: f:Microsoft Visual Studio 8WebSoccermain.aspx.cs Line: 98 Stack Trace: [SqlException (0x80131904): EXECUTE permission denied on object 'sp_insertspend', database 'master', owner 'dbo'.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857322 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734934 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838 System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) +192 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +380 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135 _Default.btnbet_Click(Object sender, EventArgs e) in f:Microsoft Visual Studio 8WebSoccermain.aspx.cs:98 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
View Replies !
View Related
Deny Remote Logins?
I was wondering if there is anyway to deny remote logins on SQL Server 7 (other then pulling the network cable out of the back :) ) so that nothing can login during a service pack upgrade? Many thanks in advance Jason
View Replies !
View Related
Deny SQL User Access
I know this seems like a strange ask, but we have a common user and pass in most of our web applications and this user requires DBO access to the database, no problem is occasioannly we need to let a developer look at an issue on a production server, so we port them through to sql through the firewall so they can see it it, and they normally login wih there domain/username and this way they are restricted to what they can see and do. However all developers know the SQL user and pass used in the web app, they also know its a DBO, so this means they can login with these user details and have access to everything. My question is how can i lock this down so i can deny access from the SQL management console for this particular user, but still allow the user to act as a DBO for the web applications. your help here is appreciated. Thanks Brad
View Replies !
View Related
Deny Insert Of Columns
Hi all, I'm trying to write a database table that is ONLY accessiable to ONE login / DB user and restrict access to what that user can do with the table. At the moment I have granted SELECT & INSERT permissions but some of the fields in the table should also be restricted, but for some reason SQL doesn't allow a deny on INSERT for columns. It seems strange that you can deny an UPDATE permission on a column but not INSERT, so users can create new lines of junk into fields you dont want them to, but cant change that junk afterward?? Anyone have any ideas how I can prevent this user from altering these fields at all? Thanks in advance
View Replies !
View Related
Deny Access To A View
I'm having trouble creating a read-only view. I've got 1 or more tables that I wish to remain updatable but I want to create a view that covers the table and/or spans all the tables. However, I want the view to be select only. I can't seem to get it to work. DENY UPDATE ON [dbo].[MyView] TO [dbo] CASCADE All that seems to execute my dbo user can still use... Update MyView set SomeID = SomeID + 10 Plus, ideally I just want to say, DENY UPDATE ON VIEW TO ALL Any thoughts?
View Replies !
View Related
Deny Access To Master
I have a login associated with a single user on a database (not master). I want that user to be able to only see what I've specified in the securables. Now I've created a ODBC connection using that login. The problem is that the user can also see the master db info. I was expecting to see just the one view I created and granted the user to view. How do I get rid of all the master db stuff?
View Replies !
View Related
Deny Permissions Not Being Honored!!
SQL2K5 SP2 I€™m trying to lock down PCI sensitive data columns in some product databases from our developers. We need developers to have data reader rights to the production database to perform general maintenance and troubleshooting of the application BUT minus the specific secured columns like credit card number, etc. I have a user role setup called RWE created by: CREATE ROLE RWE GRANT SELECT TO RWE GRANT INSERT TO RWE GRANT UPDATE TO RWE GRANT DELETE TO RWE GRANT EXECUTE TO RWE A standard SQL user is placed inside this role allowing them full read, write, and execute rights on everything in the DB which is fine. BUT, now we want those same rights except for the sensitive data files so I updated the rule with the following script: DENY SELECT ON [dbo].[TableNameHere] ([strCC]) TO [RWE] Logging in a developer and doing a SELECT * FROM TableNameHere throws a permission error on the strCC column as expected, so far so good. But, I did a SELECT * FROM ViewThatContainsField_strCC and shows them the denied field. Oh, oh! I also did EXEC spStoredProcThatShows_strCC and again it shows the denied credit card field. Again, oh, oh! So, long story short, I€™m stuck. My understanding of SQL permissions, I was under the understanding that placing a deny at the lowest level (column) should throw errors in all methods of access that column (either by direct select, or select through views, procs, etc). Any suggestions or any hints on what I€™m missing here? Thx ahead of time!
View Replies !
View Related
Localsystem Account Access Deny
Hi All, I have a SQL server, as I use a domain account to log on to SQL server and Sql server agent, all maintanence plans work good, since I changed from a domain into Localsystem account to log on to SQL server, and Sql server agent, all maintanence plans didn't work any more, then I tried only keep Localsystem account at SQl server , using a domain log on to Sql server agent, but it's still failed to maintanence plans. The error in job history is"Executed as user: candyl. sqlmaint.exe failed. [SQLSTATE 42000] (Error 22029). The step failed.". And the message at Sql server log is :"BackupDiskFile::CreateMedia: Backup device 'D:Database BackupsNoon BackupESMDEV_db_200406141548.BAK' failed to create. Operating system error = 5(Access is denied.)". It looks like permission problem, but for Localsystem account which should has full permission, right? I tried may ways and searched from knowledge base , still couldn't find the related solution. Anyone can give me some advices? Thanks.
View Replies !
View Related
Deny Execute On Sp_prepare Or Sp_execute
I have a database X where user A has db_datareader role. User A can select data but cannot update/insert/delete. Recently user A connected to my database using Brio SQRW tool and could successfully run an update command in database X. As I researched I found out that SQRW uses RPC calls with extended procedures sp_prepare and sp_execute to run an update command. User A does not have explicit permission to either of these stored procedures. Additionally User A does not have access to master database where there procedures reside. How can I prevent user A from updating my data?
View Replies !
View Related
Deny Create Schema Still Does Not Work In 2k8
You can't assign a default schema for a user that maps to a Windows group. OK fine. But if you create a user for that group anyway with no default schema, any objects created by members of that group will automatically cause a schema to be created for them, EVEN WHEN THAT USER HAS BEEN EXPLICITLY DENIED THE CREATE SCHEMA PERMISSION IN THE DATABASE. This is the same as it was in 2K5, but has still not been fixed in 2k8. To reproduce, do the following steps: Create a windows group, either in the doman or local to the box. Add at least one Windows user to that group. Create a SQL login for that Windows group. Map that login to a new user in some database. Explicitly 'deny create schema to ' that group/user. Grant 'create procedure' to that group/user. Log onto SQL with a Windows login that is a member of that Windows group Use the database that we set the permissions in above. Create a dummy stored procedure without qualifying the name with a schema ie: 'create prodedure test1 as select 'hello world'). Look to see what you ended up with. You will have a new schema named the same as the user who created the sproc. This will now be their default schema implicitly, and the test1 stored procedure will be in that schema, EVEN WHEN THAT USER WA EXPLICITLY DENIED THE CREATE SCHEMA PERMISSION IN THE DATABASE. Could you please fix this?
View Replies !
View Related
Deny User Permissions To See System Views?
Hi all, Is there any easy way to not allow a user to see system views? I have set up 1 view for a login, and I have to use an ODBC connection to access it. However, the 3rd party application I'm using is apparently timing out because of the number of tables/views that are returned. TIA! - Mark
View Replies !
View Related
SQL Deny Data Reading, Allow Modifying The Schema
Hi, I want to create a User who can create tables, views or modify them but not able to view the data from Query Analyzer or any tool on the SQL Server. I tried giving the user db_owner, Db_Denydatareader but by doing this I was not able to view data, but while modifying table or creating new table I am getting the error that the user is not having permissions on the sysobjects, sysindexes. Please help !!! Thanks chitra
View Replies !
View Related
Backup Failed, Access Deny Error. Someone Please HELP!!!!
My company is using Backup Exec to backup up All servers including the SQL Server boxes. As of late we are starting to get backup failure errors. I understand that Backup Exec cannot back up open Sql files but can someone tell me as to why I am getting Access Denied Errors on. Below is the example of the complete Error message. Someone, Anyone if you can, please assist. Thanks ahead of time. Media Name: "DIFF" Backup of "SQLServer1E$ " Backup set #43 on storage media #1 Backup set description: "Daily 5" Backup Type: DIFFERENTIAL - Changed Files Backup started on 11/07/2001 at 11:46:56 PM. The item MSSQL7DataDatabase1_Data.MDF in use - skipped. The item MSSQL7DataDatabase1_Log.LDF in use - skipped. The item MSSQL7DataDatabase2_Data.MDF in use - skipped. The item MSSQL7DataDatabase2_Log.LDF in use - skipped. The item MSSQL7Datamaster.mdf in use - skipped. The item MSSQL7Datamastlog.ldf in use - skipped. The item MSSQL7Datamodel.mdf in use - skipped. The item MSSQL7Datamodellog.ldf in use - skipped. The item MSSQL7Datamsdbdata.mdf in use - skipped. The item MSSQL7Datamsdblog.ldf in use - skipped. The item MSSQL7Dataorthwnd.ldf in use - skipped. The item MSSQL7Dataorthwnd.mdf in use - skipped. The item MSSQL7Datapubs.mdf in use - skipped. The item MSSQL7Datapubs_log.ldf in use - skipped. The item MSSQL7DataDatabase3_Data.MDF in use - skipped. The item MSSQL7DataDatabase3_Log.LDF in use - skipped. The item MSSQL7DataTEMPDB.MDF in use - skipped. The item MSSQL7DataTEMPLOG.LDF in use - skipped. Access denied to directory emp. ^ ^ ^ ^ ^ Backup completed on 11/07/2001 at 11:48:14 PM. Backed up 96 files in 48 directories.
View Replies !
View Related
Deny BuiltinAdministrators Access To Report Manager
I need to remove full admin privs from the builtinadministrator's group in report manager. I tried removing the builtinadmin role from report manager and SQL Server, I removed it from the Site Settings area and from each individual folder's permissions. Yet all the members of that group still have full run of the report server... I even made a new folder that ONLY I am listed as having permissions to, yet they can see that as well...??? Suggestions?
View Replies !
View Related
Deny Permission To Create Temporary Tables
Dear All, This is my first post to this forum. I would like to know if there is any way to restrict users from creating temp tables. Problem: I am facing problems with lots of temporary objects getting created in my database. The users have read-only access to the database for adhoc-querying purpose through QA. Yet they are able to create temporary tables in tempdb database taking lot of resources on tempdb disk causing abnormally high growth of tempdb. Thanks in advance. Best Regards, Chetan Jain
View Replies !
View Related
Network Timeout To Mirror Causes Primary To Deny Connections
We've had two instances now where when there is a network connection timeout to the mirror from the primary, the primary db server goes to 100% utilization and refuses all connections. The first time we had to reboot the primary, the 2nd time mirroring picked up again 10 minutes later. There are two dbs being mirrored, one is 15gig, the other 4gig. Both boxes are running SQL2005 64 bit and Win 2003 64bit. This happened at 6am and typically there shouldn't be a lot of traffic at that time but here are the error messages in the SQL log below. We are going to try and move db communications to a separate network and network card - but this looks like either a bug in mirroring or a configuration problem on our end - though it works just fine other times. Any thoughts/suggestions would be greatly appreciated. Thanks! Mark SQL Error Log: 11/01/2006 06:12:12,Logon,Unknown,The server was unable to load the SSL provider library needed to log in; the connection has been closed. SSL is used to encrypt either the login sequence or all communications<c/> depending on how the administrator has configured the server. See Books Online for information on this error message: 0x2746. [CLIENT: 10.16.7.7] 11/01/2006 06:12:12,Logon,Unknown,Error: 17194<c/> Severity: 16<c/> State: 1. 11/01/2006 06:12:12,Logon,Unknown,The server was unable to load the SSL provider library needed to log in; the connection has been closed. SSL is used to encrypt either the login sequence or all communications<c/> depending on how the administrator has configured the server. See Books Online for information on this error message: 0x2746. [CLIENT: 10.16.7.7] 11/01/2006 06:12:12,Logon,Unknown,Error: 17194<c/> Severity: 16<c/> State: 1. 11/01/2006 06:12:12,Logon,Unknown,The server was unable to load the SSL provider library needed to log in; the connection has been closed. SSL is used to encrypt either the login sequence or all communications<c/> depending on how the administrator has configured the server. See Books Online for information on this error message: 0x2746. [CLIENT: 10.16.7.2] 11/01/2006 06:12:12,Logon,Unknown,Error: 17194<c/> Severity: 16<c/> State: 1. 11/01/2006 06:12:11,spid22s,Unknown,Database mirroring connection error 4 '10054(An existing connection was forcibly closed by the remote host.)' for 'TCP://PYTHAGORAS.test.com:7024'. 11/01/2006 06:12:11,spid22s,Unknown,Error: 1474<c/> Severity: 16<c/> State: 1. 11/01/2006 06:04:53,spid26s,Unknown,Database mirroring is inactive for database 'NewScribe'. This is an informational message only. No user action is required. 11/01/2006 06:04:53,spid26s,Unknown,The mirroring connection to "TCP://PYTHAGORAS.test.com:7024" has timed out for database "NewScribe" after 10 seconds without a response. Check the service and network connections. 11/01/2006 06:04:53,spid26s,Unknown,Error: 1479<c/> Severity: 16<c/> State: 1. 11/01/2006 06:04:53,spid24s,Unknown,Database mirroring is inactive for database 'HL7Transfer'. This is an informational message only. No user action is required. 11/01/2006 06:04:53,spid24s,Unknown,The mirroring connection to "TCP://PYTHAGORAS.test.com:7024" has timed out for database "HL7Transfer" after 10 seconds without a response. Check the service and network connections. 11/01/2006 06:04:53,spid24s,Unknown,Error: 1479<c/> Severity: 16<c/> State: 1.
View Replies !
View Related
Deny Users Access To Database Via Management Studio
Is there a way to deny the users the ability to open a server via Management Studio but still allow remote connections. In my program I need an admin login to do various things. I am using the sa login and setting the password on install of Sql Express. But, if someone changes the password for the sa login after installation and I have the login for sa hard coded in my program, then everything will break. Is there a way to make sure that no one can change the sa password?
View Replies !
View Related
SQL 7.0 And SQL 6.5 Differences
I am curious to what major differences there are between these two versions. Trying to decide whether or not to purchase the SQL 6.5 training kit from Microsoft or not. If the code and utilities are the same, then I could probably still learn from the 6.5 version. Any thoughts, suggestions will be greatly appreciated. Thanks
View Replies !
View Related
SQL CE 3.01 And 3.5 Differences
Hi, I am having the following problem AFTER converting to VS2008 from VS2005 and SQLCE 3.5 from 3.01: SQL CE db file has a table called Court0 with various columns of type float. I populate the values by copying floats from another table/tables. I do this via ado.net using this code snippet: foreach (DataColumn column in this.mycourtsDataSet1.Tables[tableName].Columns) { string columnName = column.ColumnName.ToString(); string columnValue = aRow[0][columnName].ToString(); object cValue = aRow[0][columnName]; if (columnName.Remove(1) == "T" && !string.IsNullOrEmpty(columnValue)) { // Add the value to the Court0 table. DataRow[] bRow = this.mycourtsDataSet1.Tables["Court0"].Select("BookingPeriod = '" + columnName + "'"); if (bRow.Length > 0) { double colValue = Convert.ToDouble(cValue); //bRow[0][tableName] = Convert.ToInt32(columnValue); ========> bRow[0][tableName] = colValue; <==== colValue is '1055.01' } } } } This works fine in VS2005/CE3.01 BUT not in VS2008/CE3.5 In CE3.5, the value entered into the cell looses it's decimal value. For example, '1055.01' becomes '1055.0' in CE3.5 . Can someone explain to me why the conversion stuffs up in CE3.5 and what do I do to fix it. Thanks,
View Replies !
View Related
|