Click here to Skip to main content
15,891,864 members
Home / Discussions / Database
   

Database

 
QuestionHow do I model this? Pin
Jörgen Andersson7-Feb-17 12:58
professionalJörgen Andersson7-Feb-17 12:58 
AnswerRe: How do I model this? Pin
Mycroft Holmes7-Feb-17 21:52
professionalMycroft Holmes7-Feb-17 21:52 
GeneralRe: How do I model this? Pin
Jörgen Andersson7-Feb-17 22:03
professionalJörgen Andersson7-Feb-17 22:03 
AnswerRe: How do I model this? Pin
Gerry Schmitz9-Feb-17 8:32
mveGerry Schmitz9-Feb-17 8:32 
AnswerRe: How do I model this? Pin
Eddy Vluggen9-Feb-17 10:28
professionalEddy Vluggen9-Feb-17 10:28 
GeneralRe: How do I model this? Pin
Jörgen Andersson13-Feb-17 2:46
professionalJörgen Andersson13-Feb-17 2:46 
GeneralRe: How do I model this? Pin
Eddy Vluggen13-Feb-17 6:42
professionalEddy Vluggen13-Feb-17 6:42 
QuestionLinq-ToSQL Invalid Cast Pin
Kevin Marois2-Feb-17 6:34
professionalKevin Marois2-Feb-17 6:34 
Using Linq-To-SQL. I have this update method. I'm getting a "Specified cast is not valid exception". The line number of the exception is the query line in the inner Try/Catch.
public void UpdateDashboardInfo(AssayDashboardInfoEntity entity)
{
    try
    {
        using (var context = new AssayDashboardDataContext())
        {
            AssayDashboardInfo model = null;

            try
            {
                model = (from adi
                            in context.AssayDashboardInfos
                            where adi.ResultId.CompareTo(entity.ResultId) > 0
                            select adi).FirstOrDefault();                     // <= EXCEPTION HERE
            }
            catch (Exception e1)
            {
                _logger.Error("****** ARD_DAL: UpdateDashboardInfo (Query)", e1);
            }

            if (model != null)
            {
                model.SiteId = entity.SiteId;
                model.InstrumentId = entity.InstrumentId;
                model.TowerLocation = entity.TowerLocation;

                context.SubmitChanges();
            }
        }
    }
    catch (Exception e)
    {
        _logger.Error("********** ARD_DAL: UpdateDashboardInfo", e);
    }
}

"adi.ResultId" is a DB Guid. "entity.ResultId" is a .Net Guid in my entity class.

Anyone see what's wrong with this?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

AnswerRe: Linq-ToSQL Invalid Cast Pin
Richard Deeming2-Feb-17 7:04
mveRichard Deeming2-Feb-17 7:04 
GeneralRe: Linq-ToSQL Invalid Cast Pin
Kevin Marois2-Feb-17 7:31
professionalKevin Marois2-Feb-17 7:31 
QuestionHow to convert total database columns datetime to date in the format of dd-mm-yyyy Pin
TarunKumarSusarapu30-Jan-17 19:53
professionalTarunKumarSusarapu30-Jan-17 19:53 
AnswerRe: How to convert total database columns datetime to date in the format of dd-mm-yyyy Pin
Peter Leow30-Jan-17 20:23
professionalPeter Leow30-Jan-17 20:23 
GeneralRe: How to convert total database columns datetime to date in the format of dd-mm-yyyy Pin
TarunKumarSusarapu30-Jan-17 20:29
professionalTarunKumarSusarapu30-Jan-17 20:29 
AnswerRe: How to convert total database columns datetime to date in the format of dd-mm-yyyy Pin
Peter Leow30-Jan-17 20:46
professionalPeter Leow30-Jan-17 20:46 
GeneralRe: How to convert total database columns datetime to date in the format of dd-mm-yyyy Pin
Chris Quinn31-Jan-17 0:33
Chris Quinn31-Jan-17 0:33 
GeneralRe: How to convert total database columns datetime to date in the format of dd-mm-yyyy Pin
TarunKumarSusarapu31-Jan-17 1:07
professionalTarunKumarSusarapu31-Jan-17 1:07 
GeneralRe: How to convert total database columns datetime to date in the format of dd-mm-yyyy Pin
Richard Deeming31-Jan-17 2:29
mveRichard Deeming31-Jan-17 2:29 
GeneralRe: How to convert total database columns datetime to date in the format of dd-mm-yyyy Pin
TarunKumarSusarapu1-Feb-17 18:09
professionalTarunKumarSusarapu1-Feb-17 18:09 
GeneralRe: How to convert total database columns datetime to date in the format of dd-mm-yyyy Pin
Richard Deeming2-Feb-17 2:04
mveRichard Deeming2-Feb-17 2:04 
QuestionUsing Pooling or SqlConnection object variable is better ? Pin
MrKBA24-Jan-17 22:43
MrKBA24-Jan-17 22:43 
AnswerRe: Using Pooling or SqlConnection object variable is better ? Pin
Tim Carmichael25-Jan-17 2:31
Tim Carmichael25-Jan-17 2:31 
GeneralRe: Using Pooling or SqlConnection object variable is better ? Pin
MrKBA25-Jan-17 20:30
MrKBA25-Jan-17 20:30 
AnswerRe: Using Pooling or SqlConnection object variable is better ? Pin
Richard Deeming25-Jan-17 3:26
mveRichard Deeming25-Jan-17 3:26 
GeneralRe: Using Pooling or SqlConnection object variable is better ? Pin
MrKBA25-Jan-17 20:29
MrKBA25-Jan-17 20:29 
GeneralRe: Using Pooling or SqlConnection object variable is better ? Pin
Richard Deeming26-Jan-17 1:38
mveRichard Deeming26-Jan-17 1:38 

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.