Jul
22
2010
xiao
Symptom: You choose to run a workflow but nothing seems to happen and the new workflow doesn’t appear in the workflow tab.
Theory: If my CRM exam studyage served me right, the Microsoft Dynamics CRM is composed of 3 parts. The application layer producing the business logic, the data layer interfacing with SQL and the async service layer doing stuff like workflows on the background (a bit like SQL agent). If the first 2 break, you won’t get your CRM site at all. When the async service layer breaks, it’s a bit more subtle like in this case. Continue reading
no comments | tags: CRM, Dynamics, IIS, Microsoft, server, SQL, Windows, workflow | posted in Tips
Mar
22
2010
xiao
I don’t know actually since most of the relevant stuff becomes read-only after filling with data. But my approach is solve this as early on in the process as possible to the entirety of the data and save processing time on a custom loop after.
In other words, your DataGridView is typically bound to a DataTable. That is typically filled with stuff from the database. Make sure your AutoGenerateColumns property is set to true in the DataGridView and select your data to match the type you want to display in the DataGridView. For instance, to get checkboxes,
SELECT ..., CAST(column1 AS bit), ... FROM ...
and change the data type right out of the DataAdapter and DataGridView will figure out the rest automatically
no comments | tags: .NET, C, Microsoft, SQL, vb, visual basic | posted in Tips
Jul
16
2009
xiao
Another quick tip.
Selecting from INFORMATION_SCHEMA.COLUMNS unfortunately returns also every column in views on top of tables. I never use views and definitely don’t need those columns.
To filter them out, use:
SELECT * FROM INFORMATION_SCHEMA.COLUMNS c
JOING INFORMATION.TABLES t ON c.TABLE_NAME = t.TABLE_NAME
AND t.TABLE_TYPE = 'BASE TABLE'
no comments | tags: columns, database, Microsoft, SQL, tables, views | posted in Tips
Jun
21
2009
xiao
There are too many top Google search results giving the impression that it is impossible to compare 2 DataRows for its value contents and the programmer needs to iterate through everything himself.
Such is no longer true in .NET 3.5 but the blogosphere doesn’t seem to have caught on yet.
It is possible, given 2 DataTables or any other enumerable object types, to compare its contents using LINQ in just one line of code.
I will give an example in VB where I’d want to compare all column properties (description, data type, field length, etc) of all tables in 2 supposedly identical SQL databases. Continue reading
no comments | tags: .NET, 3.5, column, compare, content, data type, datarow, datatable, difference, how to, LINQ, Microsoft, property, reference, SQL, table, value, vb, visual basic | posted in Tips
Jun
15
2009
xiao
Another quick solution for users of MSSQL Server. 
To view the permissions the current logged SQL user has, use the command
SELECT * FROM fn_my_permissions(NULL, 'DATABASE')
or variations to return a list of SQL commands permitted.
For more details, visit the MSDN page
no comments | tags: database, Microsoft, MSSQL, permission, rights, server, SQL, user | posted in Tips