Click here to Skip to main content
15,860,972 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WPF: GroupBox background Image Pin
Hervend8-Mar-18 23:06
Hervend8-Mar-18 23:06 
GeneralRe: WPF: GroupBox background Image Pin
Hervend8-Mar-18 23:24
Hervend8-Mar-18 23:24 
GeneralRe: WPF: GroupBox background Image Pin
Hervend9-Mar-18 2:31
Hervend9-Mar-18 2:31 
AnswerRe: WPF: GroupBox background Image Pin
Leif Simon Goodwin8-Mar-18 22:47
Leif Simon Goodwin8-Mar-18 22:47 
AnswerRe: WPF: GroupBox background Image Pin
Leif Simon Goodwin8-Mar-18 22:49
Leif Simon Goodwin8-Mar-18 22:49 
GeneralRe: WPF: GroupBox background Image Pin
Hervend8-Mar-18 23:13
Hervend8-Mar-18 23:13 
GeneralRe: WPF: GroupBox background Image Pin
Leif Simon Goodwin9-Mar-18 0:38
Leif Simon Goodwin9-Mar-18 0:38 
QuestionPassing table value params to Sql Server from WPF app Pin
Christopher Duncan5-Mar-18 7:58
Christopher Duncan5-Mar-18 7:58 
For those familiar with them, TVPs are a great way to reduce the number of calls to the database and improve performance. I use them to great effect in the MVC web app using the general technique below. In the stored procedure I use a cursor to iterate through the rows and do all the db stuff in one whack.

I copied the same routines to a WPF app I'm doing, however, and it flames out calling the proc. I've since deleted it and gone the multiple calls route so I don't remember the precise error message but in general it was barking about not liking the parameters.

I'm on the same box, same version of VS, etc. and literally copied and pasted my routines. Works in MVC, no joy in WPF.

Have any of you successfully used table value parameters in a WPF app, and if so, is there a trick I'm missing?

DataTable tvp = new DataTable();
tvp.Columns.Add(new DataColumn("Id", Type.GetType("System.Int32")));
tvp.Columns.Add(new DataColumn("RowIdx", Type.GetType("System.Int32")));
tvp.Columns.Add(new DataColumn("ParentId", Type.GetType("System.Int32")));
tvp.Columns.Add(new DataColumn("MemberId", Type.GetType("System.Int32")));

DataRow row = null;
int iRowIdx = 0;

foreach (int iId in Ids)
{
	row = tvp.NewRow();
	row["Id"] = 0;
	row["RowIdx"] = iRowIdx++;
	row["ParentId"] = iListId;
	row["MemberId"] = iId;
	tvp.Rows.Add(row);
}
...
Command.Parameters.AddWithValue("@Entries", tvp);
... 
ExecuteNonQuery(), etc.


Thanks!

AnswerRe: Passing table value params to Sql Server from WPF app Pin
Richard Deeming5-Mar-18 8:23
mveRichard Deeming5-Mar-18 8:23 
GeneralRe: Passing table value params to Sql Server from WPF app Pin
Christopher Duncan5-Mar-18 11:03
Christopher Duncan5-Mar-18 11:03 
GeneralRe: Passing table value params to Sql Server from WPF app Pin
Richard Deeming5-Mar-18 12:35
mveRichard Deeming5-Mar-18 12:35 
GeneralRe: Passing table value params to Sql Server from WPF app Pin
Christopher Duncan6-Mar-18 0:43
Christopher Duncan6-Mar-18 0:43 
GeneralRe: Passing table value params to Sql Server from WPF app Pin
Christopher Duncan6-Mar-18 1:23
Christopher Duncan6-Mar-18 1:23 
GeneralRe: Passing table value params to Sql Server from WPF app Pin
Richard Deeming6-Mar-18 1:29
mveRichard Deeming6-Mar-18 1:29 
GeneralRe: Passing table value params to Sql Server from WPF app Pin
Christopher Duncan6-Mar-18 1:32
Christopher Duncan6-Mar-18 1:32 
QuestionScrollbars Not Enabling Pin
Kevin Marois1-Mar-18 5:52
professionalKevin Marois1-Mar-18 5:52 
AnswerRe: Scrollbars Not Enabling Pin
Gerry Schmitz2-Mar-18 9:59
mveGerry Schmitz2-Mar-18 9:59 
QuestionHighlight Searched Text with ListView in WPF Pin
Member 1313673327-Feb-18 14:17
Member 1313673327-Feb-18 14:17 
AnswerRe: Highlight Searched Text with ListView in WPF Pin
Richard MacCutchan27-Feb-18 21:26
mveRichard MacCutchan27-Feb-18 21:26 
AnswerRe: Highlight Searched Text with ListView in WPF Pin
Gerry Schmitz28-Feb-18 7:53
mveGerry Schmitz28-Feb-18 7:53 
QuestionWPF memory leak BitmapImage Pin
Leif Simon Goodwin21-Feb-18 1:53
Leif Simon Goodwin21-Feb-18 1:53 
AnswerRe: WPF memory leak BitmapImage Pin
#realJSOP22-Feb-18 1:32
mve#realJSOP22-Feb-18 1:32 
GeneralRe: WPF memory leak BitmapImage Pin
Leif Simon Goodwin22-Feb-18 5:30
Leif Simon Goodwin22-Feb-18 5:30 
AnswerRe: WPF memory leak BitmapImage Pin
MadMyche22-Feb-18 4:09
professionalMadMyche22-Feb-18 4:09 
GeneralRe: WPF memory leak BitmapImage Pin
Leif Simon Goodwin22-Feb-18 5:31
Leif Simon Goodwin22-Feb-18 5:31 

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.