Click here to Skip to main content
15,850,359 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: WPF: GroupBox background Image Pin
Leif Simon Goodwin8-Mar-18 23:47
Leif Simon Goodwin8-Mar-18 23:47 
AnswerRe: WPF: GroupBox background Image Pin
Leif Simon Goodwin8-Mar-18 23:49
Leif Simon Goodwin8-Mar-18 23:49 
GeneralRe: WPF: GroupBox background Image Pin
Hervend9-Mar-18 0:13
Hervend9-Mar-18 0:13 
GeneralRe: WPF: GroupBox background Image Pin
Leif Simon Goodwin9-Mar-18 1:38
Leif Simon Goodwin9-Mar-18 1:38 
QuestionPassing table value params to Sql Server from WPF app Pin
Christopher Duncan5-Mar-18 8:58
Christopher Duncan5-Mar-18 8:58 
AnswerRe: Passing table value params to Sql Server from WPF app Pin
Richard Deeming5-Mar-18 9:23
mveRichard Deeming5-Mar-18 9:23 
GeneralRe: Passing table value params to Sql Server from WPF app Pin
Christopher Duncan5-Mar-18 12:03
Christopher Duncan5-Mar-18 12:03 
GeneralRe: Passing table value params to Sql Server from WPF app Pin
Richard Deeming5-Mar-18 13:35
mveRichard Deeming5-Mar-18 13:35 
Christopher Duncan wrote:
Do you use TVPs in your ADO.NET apps?

Yes, although I tend to use the IEnumerable<SqlDataRecord> approach, rather than a DataTable.
C#
private static IEnumerable<SqlDataRecord> AsTableValuedParameter(IEnumerable<string> value)
{
    var record = new SqlDataRecord(new SqlMetaData("Value", SqlDbType.NVarChar, 0x100));
    foreach (string item in value)
    {
        record.SetValue(0, item);
        yield return record;
    }
}

...

IEnumerable<string> roleNames = ...;
var parameter = command.Parameters.AddWithValue("@RoleNames", AsTableValuedParameter(roleNames));
parameter.SqlDbType = SqlDbType.Structured;




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Passing table value params to Sql Server from WPF app Pin
Christopher Duncan6-Mar-18 1:43
Christopher Duncan6-Mar-18 1:43 
GeneralRe: Passing table value params to Sql Server from WPF app Pin
Christopher Duncan6-Mar-18 2:23
Christopher Duncan6-Mar-18 2:23 
GeneralRe: Passing table value params to Sql Server from WPF app Pin
Richard Deeming6-Mar-18 2:29
mveRichard Deeming6-Mar-18 2:29 
GeneralRe: Passing table value params to Sql Server from WPF app Pin
Christopher Duncan6-Mar-18 2:32
Christopher Duncan6-Mar-18 2:32 
QuestionScrollbars Not Enabling Pin
Kevin Marois1-Mar-18 6:52
professionalKevin Marois1-Mar-18 6:52 
AnswerRe: Scrollbars Not Enabling Pin
Gerry Schmitz2-Mar-18 10:59
mveGerry Schmitz2-Mar-18 10:59 
QuestionHighlight Searched Text with ListView in WPF Pin
Member 1313673327-Feb-18 15:17
Member 1313673327-Feb-18 15:17 
AnswerRe: Highlight Searched Text with ListView in WPF Pin
Richard MacCutchan27-Feb-18 22:26
mveRichard MacCutchan27-Feb-18 22:26 
AnswerRe: Highlight Searched Text with ListView in WPF Pin
Gerry Schmitz28-Feb-18 8:53
mveGerry Schmitz28-Feb-18 8:53 
QuestionWPF memory leak BitmapImage Pin
Leif Simon Goodwin21-Feb-18 2:53
Leif Simon Goodwin21-Feb-18 2:53 
AnswerRe: WPF memory leak BitmapImage Pin
#realJSOP22-Feb-18 2:32
mve#realJSOP22-Feb-18 2:32 
GeneralRe: WPF memory leak BitmapImage Pin
Leif Simon Goodwin22-Feb-18 6:30
Leif Simon Goodwin22-Feb-18 6:30 
AnswerRe: WPF memory leak BitmapImage Pin
MadMyche22-Feb-18 5:09
professionalMadMyche22-Feb-18 5:09 
GeneralRe: WPF memory leak BitmapImage Pin
Leif Simon Goodwin22-Feb-18 6:31
Leif Simon Goodwin22-Feb-18 6:31 
GeneralRe: WPF memory leak BitmapImage Pin
MadMyche22-Feb-18 9:31
professionalMadMyche22-Feb-18 9:31 
GeneralRe: WPF memory leak BitmapImage Pin
Leif Simon Goodwin23-Feb-18 3:36
Leif Simon Goodwin23-Feb-18 3:36 
AnswerRe: WPF memory leak BitmapImage Pin
Gerry Schmitz22-Feb-18 5:46
mveGerry Schmitz22-Feb-18 5:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.