January 20, 2012

No row was updated

Error:
- A SQL Server Database contains some tables but one of table's rows cannot be updated!!
- How i can update some NULL rows in my table ?
- Can't update rows (...) in Microsoft Visual Studio ...

Error Message:
No row was updated.
The data in row X was not committed.
Error Source: Microsoft.VisualStudio.DataTools.
Error Message: The row value(s) updated or deleted either do not make the row unique or they alter multiple rows(N rows).
Correct the errors and retry or press ESC to cancel the change(s).
Problem Causes:
This issue occurs if the following conditions are true:
- The table contains one or more columns of the text or ntext data type.
- The value of one of these columns contains the following characters:
        - Percent sign (%)
        - Underscore (_)
        - Left bracket ([)
- The table does not contain a primary key.

Solution:
This is a Microsoft BUG (BUG-925719)
There's not any solution. You need to have a new table with a primary key or correct values and copy data into new table and drop old table, Sorry.


Solution In Microsoft Visual Studio 
(NEW):

- Goto Server Explorer
- Goto Database > Tables > The Table
- RightClick and Select Edit Table Schema
ADD a new Column with these options
        - Data Type: uniqueidentifier
        - Allow Nulls: No
        - Unique: Yes
        - Primary Key: Yes
        - Is RowGuid: True
- Save and Close and open Table and update rows ;-)


REF: 
http://amastaneh.blogspot.com/2012/01/no-rows-were-deleted.html

January 19, 2012

No rows were deleted

Error:
- A SQL Server Database contains some tables but one of table's rows cannot be deleted!!
- How i can delete some NULL rows in my table ?
- Can't delete rows (...) in Microsoft Visual Studio ...

Error Message:
No rows were deleted.
A problem occured attempting to delete row 3.
Error Source: Microsft.VisualStudio.DataTools.
Error Message: The row value(s) updated or deleted either do not make
the row unique or they alter multiple rows (3 rows)
Correct the errors and attempt to delete rows again or press ESC to cancel the change(s)
Problem Causes:
This issue occurs if the following conditions are true:
- The table contains one or more columns of the text or ntext data type.
- The value of one of these columns contains the following characters:
      - Percent sign (%)
      - Underscore (_)
      - Left bracket ([)
- The table does not contain a primary key.

Solution:
This is a Microsoft BUG (BUG-925719)
There's not any solution. You need to have a new table with a primary key or correct values and copy data into new table and drop old table, Sorry.

Solution In Microsoft Visual Studio (NEW):
- Goto Server Explorer
- Goto Database > Tables > The Table
- RightClick and Select Edit Table Schema
- ADD a new Column with these options
        - Data Type: uniqueidentifier
        - Allow Nulls: No
        - Unique: Yes
        - Primary Key: Yes
        - Is RowGuid: True
- Save and Close and open Table and delete rows ;-)

REF: http://amastaneh.blogspot.com/2012/01/no-row-was-updated.html

January 07, 2012

Database does not have a valid owner


Error:
TITLE: Microsoft SQL Server Management Studio
Database diagram support objects cannot be installed because this database does not have a valid owner.  To continue, first use the Files page of the Database Properties dialog box or the ALTER AUTHORIZATION statement to set the database owner to a valid login, then add the database diagram support objects.
BUTTONS:
OK


Solution:
A really short, simple and easy solution is, change the database owner to "sa" like below image


December 20, 2011

Expand WPF TreeView


Questions
- How to expand all WPF TreeView nodes?
- Expand all nodes when a WPF TreeView is loaded
- Where is the default ExpandAll solution for WPF TreeView
- Expand all a WPF HierarchicalDataTemplate TreeView

Solution
Add below codes in XAML in TreeView tag.

  <TreeView.ItemContainerStyle>
      <Style>
          <Setter Property="TreeViewItem.IsExpanded" Value="True"/>
      </Style>
  </TreeView.ItemContainerStyle>

December 05, 2011

4.00 GB (2.99 GB usable)


Problem
- I am using Windows 7 with 4GB of RAM but system properties says 4GB RAM(2.99GB Usable) ...
- Installed 4GB RAM but the windows 7 says Usable 2.99GB RAM
- Windows 7 shows 4.096 GB(2.96 GB Usable) memory
- Why the Windows 7 memory (RAM) 4 GB (3.25 GB usable) ...


Clean Solution
You need to install Windows 7 - 64 bit

Technical Answer
A 32bit desktop windows 7 can just address 4GB of memory addresses.
This memory is include RAM + other hardware memory like Graphic Card,
Then if you have
4GB RAM + 1GB Graphic Card Memory = ~3.0 GB RAM available
4GB RAM + 512MB Graphic Card Memory = ~3.5 GB RAM available
and etc...

Physical Memory Limits: Windows 7
The following table specifies the limits on physical memory for Windows 7 [link]
VersionLimit on X86Limit on X64
Windows 7 Ultimate
4 GB
192 GB
Windows 7 Enterprise
4 GB
192 GB
Windows 7 Professional
4 GB
192 GB
Windows 7 Home Premium
4 GB
16 GB
Windows 7 Home Basic
4 GB
8 GB
Windows 7 Starter
2 GB