Click here to Skip to main content
15,917,456 members
Home / Discussions / C#
   

C#

 
AnswerDon't point back to a previous post Pin
Not Active8-Feb-10 17:47
mentorNot Active8-Feb-10 17:47 
GeneralRe: Don't point back to a previous post Pin
Nematjon Rahmanov8-Feb-10 19:11
Nematjon Rahmanov8-Feb-10 19:11 
AnswerRe: shell extention problem on 64 bit PC Pin
Dave Kreskowiak9-Feb-10 2:30
mveDave Kreskowiak9-Feb-10 2:30 
Questioncommand.exe double quoted arguments Pin
stmweb8-Feb-10 15:27
stmweb8-Feb-10 15:27 
AnswerRe: command.exe double quoted arguments Pin
Luc Pattyn8-Feb-10 16:14
sitebuilderLuc Pattyn8-Feb-10 16:14 
GeneralRe: command.exe double quoted arguments Pin
stmweb8-Feb-10 17:11
stmweb8-Feb-10 17:11 
GeneralRe: command.exe double quoted arguments Pin
Luc Pattyn8-Feb-10 23:47
sitebuilderLuc Pattyn8-Feb-10 23:47 
Questionhow would i filter results on my bindingnavigator when using a stored procedure call with linq? Pin
tonyonlinux8-Feb-10 14:54
tonyonlinux8-Feb-10 14:54 
I have a stored procedure that takes and gives me all the results based on authorFirst and authorLast
works fine when i execute it in sql server
USE [Books]
GO
/****** Object:  StoredProcedure [dbo].[usp_SelectBasedonAuthor]    Script Date: 02/08/2010 17:52:59 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/* Name: usp_SelectBasedonAuthor
   Description: Get authorfirst and last from user and do a select to get all the rows 
                meeting that criteria
   Author: Tony Stegall
   Modification Log: Change
   
   
   Description                           Date                           Author
   Created Procedure                    2/8/2010                       Tony Stegall
 
 
*/
ALTER PROCEDURE [dbo].[usp_SelectBasedonAuthor]
--Variables
@AuthorFirst varchar(50),
@AuthorLast  varchar(50)

AS

SELECT Book.*, Authors.*
FROM Book INNER JOIN 
(Authors INNER JOIN BookAuthors ON Authors.ID = BookAuthors.AuthorID) 
ON Book.ID = BookAuthors.BookID
WHERE AuthorFirst = @AuthorFirst AND AuthorLast = @AuthorLast;


in c# I have the following but obviously it is not filtering correctly and I'm not understanding why
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            try
            {
                using (var db = new mombooksDataContext(Properties.Settings.Default.BooksConnectionString2))
                {


                    String[] splitstring = null;
                    string treeviewtext = treeView1.SelectedNode.Text;
                    splitstring = treeviewtext.Split(',');
                    var filter = db.usp_SelectBasedonAuthor(authorFirstTextBox.Text, authorLastTextBox.Text);

                    bindingNavigator1.BindingSource.DataSource = filter.ToList();

                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            
        }


My objective is to click on the author name in the treeview and simply call the stored procedure based on that. and pass the results back so i can navigate the results using the bindingnavigator
AnswerRe: how would i filter results on my bindingnavigator when using a stored procedure call with linq? Pin
tonyonlinux9-Feb-10 15:37
tonyonlinux9-Feb-10 15:37 
GeneralRe: how would i filter results on my bindingnavigator when using a stored procedure call with linq? Pin
tonyonlinux9-Feb-10 16:53
tonyonlinux9-Feb-10 16:53 
QuestionCorrect technique for implementating a modal loop Pin
Jim Crafton8-Feb-10 9:00
Jim Crafton8-Feb-10 9:00 
AnswerRe: Correct technique for implementating a modal loop [modified] Pin
Luc Pattyn8-Feb-10 9:13
sitebuilderLuc Pattyn8-Feb-10 9:13 
Questiondatagridcheckbox in a datagrid Pin
prithaa8-Feb-10 7:06
prithaa8-Feb-10 7:06 
AnswerRe: datagridcheckbox in a datagrid Pin
OriginalGriff8-Feb-10 8:27
mveOriginalGriff8-Feb-10 8:27 
GeneralRe: datagridcheckbox in a datagrid Pin
prithaa8-Feb-10 17:30
prithaa8-Feb-10 17:30 
QuestionSure this has been asked before but can not find answer (c# prototypes) Pin
Andy Braham8-Feb-10 6:16
Andy Braham8-Feb-10 6:16 
AnswerRe: Sure this has been asked before but can not find answer (c# prototypes) Pin
OriginalGriff8-Feb-10 6:27
mveOriginalGriff8-Feb-10 6:27 
GeneralRe: Sure this has been asked before but can not find answer (c# prototypes) Pin
Andy Braham8-Feb-10 7:21
Andy Braham8-Feb-10 7:21 
GeneralRe: Sure this has been asked before but can not find answer (c# prototypes) Pin
Dave Kreskowiak8-Feb-10 7:25
mveDave Kreskowiak8-Feb-10 7:25 
GeneralRe: Sure this has been asked before but can not find answer (c# prototypes) Pin
harold aptroot8-Feb-10 7:40
harold aptroot8-Feb-10 7:40 
GeneralRe: Sure this has been asked before but can not find answer (c# prototypes) Pin
DaveyM698-Feb-10 8:03
professionalDaveyM698-Feb-10 8:03 
AnswerRe: Sure this has been asked before but can not find answer (c# prototypes) Pin
Richard MacCutchan8-Feb-10 6:56
mveRichard MacCutchan8-Feb-10 6:56 
Questionzipping an xml file Pin
Shtel8-Feb-10 4:29
Shtel8-Feb-10 4:29 
AnswerRe: zipping an xml file Pin
musefan8-Feb-10 4:42
musefan8-Feb-10 4:42 
GeneralRe: zipping an xml file Pin
Shtel8-Feb-10 5:01
Shtel8-Feb-10 5:01 

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.