Click here to Skip to main content
15,887,425 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Data Access Layer, returning data Pin
jkirkerx7-Jul-15 10:40
professionaljkirkerx7-Jul-15 10:40 
GeneralRe: Data Access Layer, returning data Pin
Dave Kreskowiak7-Jul-15 10:50
mveDave Kreskowiak7-Jul-15 10:50 
GeneralRe: Data Access Layer, returning data Pin
jkirkerx7-Jul-15 11:20
professionaljkirkerx7-Jul-15 11:20 
GeneralRe: Data Access Layer, returning data Pin
jkirkerx7-Jul-15 11:27
professionaljkirkerx7-Jul-15 11:27 
GeneralRe: Data Access Layer, returning data Pin
Dave Kreskowiak7-Jul-15 14:54
mveDave Kreskowiak7-Jul-15 14:54 
GeneralRe: Data Access Layer, returning data Pin
jkirkerx8-Jul-15 12:46
professionaljkirkerx8-Jul-15 12:46 
GeneralRe: Data Access Layer, returning data Pin
Dave Kreskowiak8-Jul-15 14:56
mveDave Kreskowiak8-Jul-15 14:56 
AnswerRe: Data Access Layer, How to get the count, and use the data returned by the first function posted above Pin
jkirkerx7-Jul-15 14:04
professionaljkirkerx7-Jul-15 14:04 
I'm trying to figure out how to get the count of records. I was just expecting the other fucntion to give me a count as IEnumerable, but it doesn't provide it.

So I wrote this, not sure if it's right, because I get 0 back, and there's 4
Do you think this is because the database was already existing, and it's related to Code First.

On the previous function, I'm not sure if I'm getting data back or not, and not quite sure how to use the returned output.
This calls the previous function in the post above. I didn't want to repost it again.
Dim m_count As Integer = shared_MovieInfo.get_index_count(shared_MovieInfo.MovieType.FLV)
Dim movies As IEnumerable(Of MovieItem)
movies = shared_MovieInfo.load_index_array(shared_MovieInfo.SortOrder.Name, shared_MovieInfo.MovieType.FLV)

So I'm thinking you just use it like this
For Each m As Object In movies
  Dim m_MovieName_Encoded As String = System.Web.HttpUtility.HtmlEncode(m.MovieName)
Next

Count Function that I wrote. I tried the shorter method, but the MovieContext wasn't shared, said the compiler.
Not sure what to do with that message, But I get 0 back as a result.
I really wanted to use just 1 function for the data and the count.
Public Shared Function get_index_count( _
        ByVal pType As MovieType) As Integer

        Dim context As New MoviesContext()
        Dim pValue = (From item In context.Movies
                      Where item.flv = 1
                      Select item).Count()

        Return pValue

    End Function

GeneralRe: Data Access Layer, How to get the count, and use the data returned by the first function posted above Pin
Dave Kreskowiak7-Jul-15 15:09
mveDave Kreskowiak7-Jul-15 15:09 
GeneralRe: Data Access Layer, How to get the count, and use the data returned by the first function posted above Pin
jkirkerx8-Jul-15 6:45
professionaljkirkerx8-Jul-15 6:45 
GeneralRe: Data Access Layer, How to get the count, and use the data returned by the first function posted above Pin
jkirkerx8-Jul-15 7:40
professionaljkirkerx8-Jul-15 7:40 
GeneralRe: Data Access Layer, How to get the count, and use the data returned by the first function posted above Pin
Dave Kreskowiak8-Jul-15 9:58
mveDave Kreskowiak8-Jul-15 9:58 
GeneralRe: Data Access Layer, How to get the count, and use the data returned by the first function posted above Pin
jkirkerx8-Jul-15 10:37
professionaljkirkerx8-Jul-15 10:37 
GeneralRe: Data Access Layer, How to get the count, and use the data returned by the first function posted above Pin
Dave Kreskowiak8-Jul-15 11:15
mveDave Kreskowiak8-Jul-15 11:15 
GeneralRe: How to load a single record, and with a join Pin
jkirkerx9-Jul-15 9:08
professionaljkirkerx9-Jul-15 9:08 
GeneralRe: How to load a single record, and with a join Pin
Dave Kreskowiak9-Jul-15 12:08
mveDave Kreskowiak9-Jul-15 12:08 
GeneralRe: How to load a single record, and with a join Pin
jkirkerx9-Jul-15 12:31
professionaljkirkerx9-Jul-15 12:31 
QuestionPrint RDLC without preview using VB.NET Pin
emmapaq6-Jul-15 10:00
emmapaq6-Jul-15 10:00 
QuestionExcel VBA Function runtime error 1004: Application-defined or object-defined error Pin
Member 118122063-Jul-15 11:57
Member 118122063-Jul-15 11:57 
SuggestionRe: Excel VBA Function runtime error 1004: Application-defined or object-defined error Pin
Richard MacCutchan3-Jul-15 21:28
mveRichard MacCutchan3-Jul-15 21:28 
QuestionPublic Delegate Sub Action(Of T) (obj As T) Pin
Member 1171394230-Jun-15 20:23
Member 1171394230-Jun-15 20:23 
AnswerRe: Public Delegate Sub Action(Of T) (obj As T) Pin
Richard MacCutchan30-Jun-15 21:21
mveRichard MacCutchan30-Jun-15 21:21 
QuestionFirstData G4 V14 HMAC Header Pin
jkirkerx29-Jun-15 13:47
professionaljkirkerx29-Jun-15 13:47 
AnswerRe: FirstData G4 V14 HMAC Header Pin
Jörgen Andersson29-Jun-15 20:17
professionalJörgen Andersson29-Jun-15 20:17 
GeneralRe: FirstData G4 V14 HMAC Header Pin
jkirkerx30-Jun-15 6:49
professionaljkirkerx30-Jun-15 6:49 

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.