Click here to Skip to main content
15,920,030 members
Home / Discussions / Database
   

Database

 
QuestionSQL Linq, query and then take result to query again Pin
jkirkerx10-Jul-15 7:43
professionaljkirkerx10-Jul-15 7:43 
Answer[Solved] Pin
jkirkerx10-Jul-15 8:53
professionaljkirkerx10-Jul-15 8:53 
QuestionSELECT then INSERT data in a matrix way Pin
Farhad Eft9-Jul-15 9:14
Farhad Eft9-Jul-15 9:14 
AnswerRe: SELECT then INSERT data in a matrix way Pin
Richard Deeming9-Jul-15 9:22
mveRichard Deeming9-Jul-15 9:22 
GeneralRe: SELECT then INSERT data in a matrix way Pin
Farhad Eft9-Jul-15 10:51
Farhad Eft9-Jul-15 10:51 
QuestionSQL Linq, concepts of writing queries Pin
jkirkerx8-Jul-15 8:55
professionaljkirkerx8-Jul-15 8:55 
AnswerRe: SQL Linq, concepts of writing queries Pin
Richard Deeming8-Jul-15 10:46
mveRichard Deeming8-Jul-15 10:46 
GeneralRe: SQL Linq, concepts of writing queries Pin
jkirkerx8-Jul-15 12:32
professionaljkirkerx8-Jul-15 12:32 
That's Radical Man!

It works like a charm. I figured out that Movies was my Model, and imported the Namespace for it.
So I did some tweaks to get the record selection right, records displayed.

I'm still stuck on using the context, instead of Dimensioning it, but the base of what I project into gets disposed before I can generate the HTML. So that's another subject.

This SQL Linq is quite interesting, and seems to offer everything hand typed queries offer. It's fast.
I'm stoked on my Data Access Layer DLL, Seems to be working. I know the model works now.

If I can convert my asp.net webforms app program over to this, and be able to automatically create a database, and seed it with default values, and then if I change the database in one spot, and I can propagate the changes throughout the program, then I'm done.
All I have to do is adopt the BootStrap CSS Concept used in MVC, and I can sell this thing finally.

Thanks for taking the time to school me on this. I owe you the price of tuition for it. - Street Outlaws

And Here's what I got.
Public Shared Function load_index_array( _
        ByVal pType As MovieType,
        ByVal pSortOrder As SortOrder,
        ByVal pPageIndex As Integer,
        ByVal pPageSize As Integer,
        ByRef pResults As IEnumerable(Of MovieItem)) As Integer

        Dim pValue As Integer = 0

        Dim context As New MoviesContext()
        Dim movies As IQueryable(Of Movies) = context.Movies

        'Sort Order
        Select Case pSortOrder
            Case SortOrder.Name
                movies = movies.OrderBy(Function(m) m.MovieName)
            Case SortOrder.Type
                movies = movies.OrderBy(Function(m) m.MovieType)
            Case SortOrder.Time
                movies = movies.OrderBy(Function(m) m.MovieTime)
            Case SortOrder.Lastest
                movies = movies.OrderByDescending(Function(m) m.MoviePostDate)
            Case SortOrder.Early
                movies = movies.OrderBy(Function(m) m.MoviePostDate)
        End Select

        'Filter By Type
        Select Case pType
            Case MovieType.FLV
                movies = movies.Where(Function(m) m.flv)
            Case MovieType.H264
                movies = movies.Where(Function(m) m.h264)
        End Select

        'Get a Single Page of Data
        If (pPageIndex = 1) Then
            movies = movies.Take(pPageSize)
        Else
            movies = movies.Skip((pPageIndex - 1) * pPageSize).Take(pPageSize)
        End If

        pResults =
            movies.AsEnumerable().Select(Function(item) New MovieItem With
            {
                .MovieID = item.MovieID,
                .MovieName = item.MovieName,
                .MovieType = item.MovieType,
                .MovieDeliveryType = item.MovieDeliveryType,
                .MoviePath = item.MoviePath,
                .MovieUrl = item.MovieURL,
                .MoviePostage = item.MoviePostage,
                .MovieThumbnail = item.MovieThumbnail,
                .MovieLarge = item.MovieLarge,
                .MoviePlaceHolder = item.MoviePlaceHolder,
                .MovieBitRate = item.MovieBitRate,
                .MovieTime = item.MovieTime,
                .MovieSize = item.MovieSize,
                .MovieDescription = item.MovieDescription,
                .MovieCount = item.MovieCount,
                .MovieContributor = item.MovieContributor,
                .MoviePostDate = item.MoviePostDate,
                .MovieIcon = item.MovieIcon,
                .MovieParameters = item.movie_Parameters
        }).AsEnumerable

        pValue = pResults.Count()

        Return pValue

    End Function

Questionssrs rendering format ppt pptx Pin
Aurelkb5-Jul-15 23:35
Aurelkb5-Jul-15 23:35 
AnswerRe: ssrs rendering format ppt pptx Pin
Richard MacCutchan6-Jul-15 0:13
mveRichard MacCutchan6-Jul-15 0:13 
QuestionEvaluate returnvalues of stored procedures used in TableAdapterManager.UpdateAll Pin
atrus27113-Jul-15 1:49
atrus27113-Jul-15 1:49 
AnswerRe: Evaluate returnvalues of stored procedures used in TableAdapterManager.UpdateAll Pin
atrus27113-Jul-15 2:39
atrus27113-Jul-15 2:39 
QuestionOracle Query Builder Pin
Mycroft Holmes30-Jun-15 14:18
professionalMycroft Holmes30-Jun-15 14:18 
AnswerRe: Oracle Query Builder Pin
Jörgen Andersson7-Jul-15 8:40
professionalJörgen Andersson7-Jul-15 8:40 
QuestionEntity Framework 6.0.3 problem Pin
Mark Miller24-Jun-15 10:42
Mark Miller24-Jun-15 10:42 
AnswerRe: Entity Framework 6.0.3 problem Pin
Mark Miller1-Jul-15 9:49
Mark Miller1-Jul-15 9:49 
Questionstop accessing peoples SQL server through SQL management Studio. Pin
Azam Niaz Ch.21-Jun-15 9:06
Azam Niaz Ch.21-Jun-15 9:06 
AnswerRe: stop accessing peoples SQL server through SQL management Studio. Pin
PIEBALDconsult21-Jun-15 9:24
mvePIEBALDconsult21-Jun-15 9:24 
GeneralRe: stop accessing peoples SQL server through SQL management Studio. Pin
Azam Niaz Ch.21-Jun-15 18:21
Azam Niaz Ch.21-Jun-15 18:21 
GeneralRe: stop accessing peoples SQL server through SQL management Studio. Pin
PIEBALDconsult21-Jun-15 18:28
mvePIEBALDconsult21-Jun-15 18:28 
GeneralRe: stop accessing peoples SQL server through SQL management Studio. Pin
scottgp22-Jun-15 1:19
professionalscottgp22-Jun-15 1:19 
GeneralRe: stop accessing peoples SQL server through SQL management Studio. Pin
Eddy Vluggen22-Jun-15 1:36
professionalEddy Vluggen22-Jun-15 1:36 
AnswerRe: stop accessing peoples SQL server through SQL management Studio. Pin
Mycroft Holmes21-Jun-15 19:57
professionalMycroft Holmes21-Jun-15 19:57 
AnswerRe: stop accessing peoples SQL server through SQL management Studio. Pin
GuyThiebaut21-Jun-15 21:24
professionalGuyThiebaut21-Jun-15 21:24 
GeneralRe: stop accessing peoples SQL server through SQL management Studio. Pin
Mycroft Holmes22-Jun-15 14:13
professionalMycroft Holmes22-Jun-15 14:13 

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.