Blog Posts List

The SqlMembershipProvider requires a database schema compatible with schema version 1

by Yugolancer

Posted on October 31, 2016

If you get this error it means that the default values are missing from your database.

To resolve/fix the issue, just execute the following SQL code against your database:

   ('common', 1, 1),
   ('health monitoring', 1, 1),
   ('membership', 1, 1),
   ('personalization', 1, 1),
   ('profile', 1, 1),
   ('role manager', 1, 1);

Read More

Prevent RadGrid hierarchy collapsign after edit/delete

by Yugolancer

Posted on December 09, 2016

In the past you had to retain the expanded state manually when the grid rebinds, but recently Telerik introduced a property named RetainExpandStateOnRebind. If it's true, the expanded state persists automatically.


Read More

Retrieve data contained in a comma-delimited list of values Warning!


Posted on June 03, 2017

Say that you have a comma-separated String containing user IDs like following:

String userIDs = "1,2,5,8,23,67,101";

and that you want to fetch those users without splitting and looping their IDs.

Usually you do use CharIndex to search the expression:

command.CommandText = 
    "SELECT * FROM Users WHERE  CharIndex(CAST(userID AS varchar(8)) + ',', + @userIDs) > 0";
command.Parameters.AddWithValue"@userIDs", userIDs;

However if you execute the above query the last ID will be omitted YEAH it will be indeed because it checks against value + comma which does not match when it comes to 101.

FIX: add the missing comma to the end of the string:

command.Parameters.AddWithValue"@userIDs", userIDs + ",";

Hope this helps someone!

Read More

Page 1 of 1

Copyright © ASPNETer 2006 - 2016