VS2008 Linq To SQL Dataset SetDatasource

Here is the problem and I have found no helpful solution. I am using LinqToSQL to pull the data into a dataset. No problems there. The problem comes when assigning that dataset as the datasource for a Crystal Report. When I run the report it says
System.NotSupportedException was unhandled
  Message="DataSet does not support System.Nullable<>."
  Source="System.Data"
  StackTrace:
       at System.Data.DataColumn..ctor(String columnName, Type dataType, String expr, MappingType type)
       at System.Data.DataColumn..ctor(String columnName, Type dataType)
       at System.Data.DataColumnCollection.Add(String columnName, Type type)
       at CrystalDecisions.CrystalReports.Engine.Table.BuildTableFromEnumerable(IEnumerable collection, Type dataClassType, String tableName)
       at CrystalDecisions.CrystalReports.Engine.Table.EnumerableToDataSet(IEnumerable collection)
       at CrystalDecisions.CrystalReports.Engine.Table.WrapAndCacheDotNetObject(Object val, Type type, IntPtr& pUnkDataSet, IntPtr& pDotNetDelegate)
       at CrystalDecisions.CrystalReports.Engine.Table.SetDataSource(Object val, Type type)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(IEnumerable enumerable)
       at Pack_Win.frmReports.crystalReportViewer1_Load(Object sender, EventArgs e) in C:\VersioningVS2008\Pack-Win\Pack-Win\Pack-Win\frmReports.cs:line 32
       at System.Windows.Forms.UserControl.OnLoad(EventArgs e)
       at CrystalDecisions.Windows.Forms.CrystalReportViewer.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  InnerException:
I have seen references to defaulting the nullables but can't find sample code. Can anyone help with this?

I have the dataset populated using the code below and was able to create a working report.
DataSet fds = new DataSet();
            ReportDocument rd = new ReportDocument();
            if (currfunc == "CustList")
                rd.Load(@".\Reports\CustList.rpt");
                PackWinDataSet.PACK_CUSTOMERDataTable repdt = new PackWinDataSet.PACK_CUSTOMERDataTable();
                PackWinDataSetTableAdapters.PACK_CUSTOMERTableAdapter repdat = new Pack_Win._Pack_WinDataSetTableAdapters.PACK_CUSTOMERTableAdapter();
                repdat.Fill(repdt);
                fds.Tables.Add(repdt);
                rd.SetDataSource(fds);

Similar Messages

  • Displaying the data from a "LINQ to SQL database"

    I have created a LINQ to SQL database with a simple table/class with the following properties:
    Counter
    Subject
    Description
    About the Counter, how do I set the properties so it behaves like a "Counter". For each row I want it to automatically add new numbers like this:
    1 Subject1 Decsription1
    2 Subject2 Description2
    3 Subject3 Description3...and so on for every new data inserted.
    For now I have "Auto Generated Value=True" and "Primary Key=True". Is that the right way to go? What do I set for "Auto-Sync"? There are options like "Never, OnInsert, OnUpdate, Always".
    I believe I've manage to do the coding for the insert part:
    private void btnAddReminder_Click(object sender, RoutedEventArgs e)
    DataClasses1DataContext db = new DataClasses1DataContext("db");
    Reminders reminder = new Reminders();
    reminder.Subject = txtSubject.Text;
    reminder.Description = txtDescription.Text;
    db.Reminders.InsertOnSubmit(reminder);
    MessageBox.Show("Content added!");
    Now first of all, is there a way I can display the database content directly in Visual Studio so I can see if I've manage to add any content in the table? I haven't yet find a way so far.
    Second how do I get the content from the datatable row by row and display it in MainWindow.xaml? What would the code look like? For every row I would like it to be displayed like this:
    1. Subject1
    Description1
    2. Subject2
    Description2
    3. Subject3
    Description3
    Is it possible to display "1. Subject1" in a Label. It should be sort of a headline.
    Then would it be possible to display "Description1" in a TextBlock?
    The idea is that Subject along with the number should have a larger font size, and the Description shoud be a bit smaller font size.
     

    >>For now I have "Auto Generated Value=True" and "Primary Key=True". Is that the right way to go?
    Yes, this means that the database takes care of the actual incrementation for you which is perfectly fine and probably what you want.
    >>how do I get the content from the datatable row by row and display it in MainWindow.xaml
    You need to an ItemsControl that can render all items in a collection somewhere in the MainWindow, e.g.:
    <ItemsControl x:Name="ic">
    <ItemsControl.ItemTemplate>
    <DataTemplate>
    <StackPanel>
    <StackPanel Orientation="Horizontal" Margin="0 0 0 10">
    <TextBlock Text="{Binding Counter}"/>
    <TextBlock Text=". "/>
    <TextBlock Text="{Binding Subject}"/>
    </StackPanel>
    <TextBlock Text="{Binding Description}"/>
    </StackPanel>
    </DataTemplate>
    </ItemsControl.ItemTemplate>
    </ItemsControl>
    The ItemTemplate (DataTemplate) of the ItemsControl defines the appearance of each item in its ItemsSource collection, i.e. a Reminders object in your case.
    You then simply set the ItemsSource of the ItemsControl to the collection of Reminders object that you want to display in it in your code:
    private void btnAddReminder_Click(object sender, RoutedEventArgs e)
    DataClasses1DataContext db = new DataClasses1DataContext("db");
    Reminders reminder = new Reminders();
    reminder.Subject = txtSubject.Text;
    reminder.Description = txtDescription.Text;
    db.Reminders.InsertOnSubmit(reminder);
    MessageBox.Show("Content added!");
    ic.ItemsSource = db.Reminders;
    >>is there a way I can display the database content directly in Visual Studio so I can see if I've manage to add any content in the table?
    First of all, please don't ask several questions in the same thread. Second, this is not a WPF question. If you are using a service-based database, you could select data from it from the Server Explorer in Visual Studio:
    http://msdn.microsoft.com/en-us/library/vstudio/ms233763(v=vs.120).aspx. Otherwise you typically use SQL Sever Management Studio to query a database. For Visual Studio specific questions, please use the Visual Studio forums:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=visualstudio%2Cvsarch%2Cvsdbg%2Cvstest%2Cvstfs%2Cvsdata%2Cvsappdev%2Cvisualbasic%2Cvisualcsharp%2Cvisualc
    Please remember to mark helpful posts as answer and/or helpful.

  • Level of local SQLCE/other DB support in windows phone 8.1/using linq to sql from dll?

    I have had a mixed opinion for SQLCE support in windows phone 8/8.1. Is their still support for a local SQLCE or other database in windows phone 8.1? (A lot of different blog articles created their own handlers it appears and one used
    an visual studio app called SQLmetal) I am hoping to at least figure out the libraries to use for Linq to SQL in windows phone 8.1 in order to access a local Database. I only need to retrieve data from a simple Database with one -
    two tables and one of the tables has three fields.
    I wish to access the local DB from a dll file even if I have to use Linq to SQL. The reason for this is to store data for a simple game while the app is running. However, I may need to send data to the database and would like to separate that
    from the main application if possible. The only other question is: how do I add local database support to a dll file in windows phone 8.1? (This is my main objective but I need to know my database options first)
    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering
    - Yoda. Blog - http://www.computerprofessions.co.nr

    Windows Phone Silverlight 8.1 apps can still use LINQ to SQL (System.Data.Linq) see:
    http://msdn.microsoft.com/en-us/library/windows/apps/hh202860(v=vs.105).aspx
    For Windows Phone 8.1 [runtime] app you would need to use an external library like
    SQLite 
    There is a jumpstart training talk on using SQLite in Windows Phone 8.1 apps here:
    http://channel9.msdn.com/Series/Building-Apps-for-Windows-Phone-8-1/19
    I'm not sure what you mean by: "...access the local DB from a dll file..."  Do you mean you want the library used to access the database to be portable across
    platforms?
    Eric Fleck, Windows Store and Windows Phone Developer Support. If you would like to provide feedback or suggestions for future improvements to the Windows Phone SDK please go to http://wpdev.uservoice.com/ where you can post your suggestions and/or cast
    your votes for existing suggestions.
    I saw the first link and I think I have already been through some of that tutorial on channel 9 already.
    I'm not sure what you mean by: "...access the local DB from a dll file..."  Do you mean you want the library used to access the database to be portable across platforms?
    This would be a yes. I need use it to submit an application to the store (I wish to have the data and business logic in the dll file while having the GUI separate). I am currently using the portable dll but if you think using another dll type would help
    I will try that. I am a VB.NET programmer and so I can see where some programmers get their worries about SQLCE (It seems a lot of VB and VB.NET programmers like it from my time helping on the VB.NET forums second to SQL Server only).
    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering
    - Yoda. Blog - http://www.computerprofessions.co.nr
    Nevermind, I changed the dll type to "Silverlight" and I can use the System.Data.Linq reference at least.
    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to
    suffering - Yoda. Blog - http://www.computerprofessions.co.nr

  • SQL Dataset errors in BIP 11G Trial Edition

    Hi
    I'm trialling 11G and trying to get a SQL dataset to work which is used in our 10.1.3.4.2 installation.
    The SQL queries a package which calls an inline function to return results based on Parameter values.
    This works without error both in the 10G instance and when run separately in PL/SQL Developer, but returns:
    'ORA-00933: SQL command not properly ended' when I attempt to add it in the 11G Query Builder.
    Is there some thing obvious I'm missing here? The oracle user under which the SQL runs has the necessary privileges to the objects.
    SQL is:
    SELECT
    COL004 as stream,
    COL006 as MSISDN,
    COL007 as IMEI,
    COL008 as IMSI,
    COL009 as Start_Date,
    COL010 as End_Date,
    COL011 as Success,
    COL012 as Failed,
    COL013 as Service_Provider,
    COL014 as Subscriber_Type,
    COL015 as Handset_Model,
    COL016 as Blacklist_Date,
    GROUPING_COLUMN as GROUPING_COLUMN
    FROM TABLE(nmo_pdf_reports.get_results(:PDF_ID, 1, 1, :pHsetMSISDN))
    where 1 in (nvl(:queryTypeID,1))
    'nmo_pdf_reports' is the package, and 'get_results' is the function.
    Parameters are ':PDF_ID', ':pHsetMSISDN' and ':queryTypeID'
    However, once I remove the parameters and replace them with actual values, the SQL is saved - although the report then runs with a different error.
    Anyone have any suggestions..?

    Hi Svee
    This does work, but I need to have this filter.
    Strangely it will work if use 'where 1 = (nvl(:queryTypeID, 1))'. I could maybe try moving it into the 'Conditions' tab of the query builder - but it does not allow this, saying 'the query could not be parsed'.
    I found after I posted that what also works is if I first define my parameters (i.e. PDF_ID, queryTypeID, pHsetMSISDN), and then try to recompile the dataset - I was not prompted to create the params as defined in the documentation. Is this because it's a custom SQL that does not utilise the query builder?
    thanks
    D.
    Edited by: Donal on Jul 17, 2012 7:31 AM

  • Oracle XSU class oracle.xml.sql.dataset.OracleXMLDataSetExtJdbc bug

    Hi,
    The oracle class oracle.xml.sql.dataset.OracleXMLDataSetExtJdbc needlessly casts the java.sql.Connection it receives in its constructor to oracle.jdbc.driver.OracleConnection.
    This will work fine in most circumstances, but throws a class cast exception when a proxified connection is used such that the connection is a wrapper rather than an instance of OracleConnection.
    I believe there would be absolutely no need for the oracle class to cast the connection to its derived form.
    Please correct this problem in the XSU as soon as possible.
    Thanks in advance,
    -- Dave Campbell

    Yes, of course I have. If you carefully see my first post, you will notice that I get an
    'ORA-00904: invalid column name' error when I - in purpose - use an invalid Query, which means that communication with Oracle DB is fine. The problem appears when my Query does return some results. It's really confusing me...
    Any other ideas?
    thanks!
    -n-
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jinyu Wang ([email protected]):
    Have you include JDBC lib in your classpath?<HR></BLOCKQUOTE>
    null

  • Linq to sql return dynamic table

    Hi,
    I am looking to use linq to sql like I did with ADO and return a dynamic table like I did with a datatable.
    I will not know what table/fields will return until runtime.  I later want to loop through the return table and get the field names and values.
    if this was a datatable it would look something like
    System.Data.
    DataTable
    dt = new
    DataTable();
    foreach
    (DataRow
    dr in
    dt.Rows )
    string
    fieldName = dt.Columns[0].ColumnName;
    string
    values = dr[0].ToString();
    Here is my linq to sql but dynamic will not work
    var
    recordSet = (db.ExecuteQuery<dynamic>(sql,

    Andrew;
    You seem to be having the same issue I am (for which, by the way, no one seems to have the answers);
    1.  A data object being passed to your class/methods
    2.  Another object being passed containing the "fields"/properties the user wants returned from the data
    I've been trying to make something like this work
    List
    IQueryable
    subset = from
    a in
    rawdata select
    (<<dataFields>>);
    ... Tantamount to passing a fields list into an SQL query (macro expansion?).  Unfortunately, LINQ wants to treat whatever is passed in the select
    as a literal.
    If you come up with an answer, please let me know.  I have solved every other issue in my code (including a rather clever GroupByMany cobbled
    together from various leads from other posts), but am stuck at this one.
    <string>
    dataFields = datapoints.ToList<string>();

  • LINQ to SQL - UPDATE Foreign Key

    Hi,
    I'm doing a project with LINQ to SQL. I'm mapping the database in code.
    I have 2 tables: Cargo(CodCargo PK, Cargo)
                            Utilizador(CodUtilizador PK, Utilizador, CodCargo FK. 
    Cargo:
     1 - Client
     2 - Provider
     3 - Administrator
    Utilizador:
     1 - User1 - 2
     2 - User2 - 3
    Code in Class Utilizador:
    private EntityRef<Cargo> _Cargo = new EntityRef<Cargo>();
    [Association(IsForeignKey = true, Storage = "_Cargo", ThisKey = "CodCargo")]
    public Cargo Cargo
    get { return this._Cargo.Entity; }
    set
    Cargo oldCargo = _Cargo.Entity;
    Cargo newCargo = value;
    if (newCargo != oldCargo)
    _Cargo.Entity = null;
    if (oldCargo != null)
    oldCargo.Utilizador.Remove(this);
    _Cargo.Entity = newCargo;
    if (newCargo != null)
    newCargo.Utilizador.Add(this);
    The problem is when I change for example in User1 this: User1.Cargo.Cargo = "Client"; Table "Cargo" change to this:
     1 - Client
     2 - Client
     3 - Administrator
    It shouldn't change, only the CodCargo on Utilizador should change.
    How can I solve this without change Cargo , only updating the CodCargo on Utilizador if the field exists or create a new Cargo if don't.
    Best regards,
    ADAE.

    Hello,
    >>//Is is possible to do this:newUser.Cargo.Cargo = "Client"
    This is not changed the foreign key constraint, it only performs what you see: change the
     2 – Provider to  1 – Client, this is not controlled by Entity Framework, it is a rule of database. It is called foreign key constraint:
    https://technet.microsoft.com/en-us/library/ms175464%28v=sql.105%29.aspx?f=255&MSPPError=-2147217396, since the Entity Framework is an ORM framework, it will follow this rule.
    My suggestion is that you could do what I provide, to set it foreign key property.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Linq to SQL Error. The member 'Sel.UserClass.FBId' has no supported translation to SQL.

    I'm getting the above error while trying to do a really simple query..
    Dim data = From d In dc.Users Where d.FBId.Equals(userId)
    Here's the class..
    <Table> _
    Public Class UserClass
    <Column(IsDbGenerated:=True, IsPrimaryKey:=True)> _
    Public Property Id() As Integer
    Get
    Return m_Id
    End Get
    Set(value As Integer)
    m_Id = value
    End Set
    End Property
    Private m_Id As Integer
    Public Property FBId() As String
    Get
    Return m_FBId
    End Get
    Set(value As String)
    m_FBId = value
    End Set
    End Property
    Private m_FBId As String
    <Column> _
    Public Property UserName() As String
    Get
    Return m_UserName
    End Get
    Set(value As String)
    m_UserName = value
    End Set
    End Property
    Private m_UserName As String
    End Class
    Any ideas why ?

    Hello,
    I am not sure if this is a windows phone question. Maybe you can post thread on LINQ to SQL forum for support.
    https://social.msdn.microsoft.com/Forums/en-US/home?forum=linqtosql.
    To save your time, you can try to mark FBId property with Column attribute like Id property. This can help LINQ to SQL to know how to make mapping with those properties. Please try it.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate
    the survey.

  • DataGridView use with LINQ query (MCTS 70-505 Ch 6 Lesson 6 page 321 Exercise 2 "LINQ to SQL")

    Option Strict Off
    Imports System.Data.Linq
    Imports System.Data.Linq.Mapping
    <Table(Name:="Customers")> _
    Public Class Customer
    Dim db As New DataContext("Data Source = .\sqlexpress; Initial Catalog=Northwind; Integrated Security = true")
    Dim customers As Table(Of Customer)
    Private _customerID As String
    <Column(IsPrimarykey:=True, storage:="_customerID")> _
    Public Property CustomerID() As String
    Get
    Return _customerID
    End Get
    Set(value As String)
    _customerID = value
    End Set
    End Property
    Private _ContactName As String
    <Column(Storage:="_ContactName")> _
    Public Property ContactName() As String
    Get
    Return _ContactName
    End Get
    Set(value As String)
    _ContactName = value
    End Set
    End Property
    Private _CompanyName As String
    <Column(Storage:="_CompanyName")> _
    Public Overloads Property CompanyName() As String ' does not appear. Its a member of control base class. Shadows does not help, though it should
    Get ' because the name of the column in the db happens to be the same as this property of the Control class. Overloads no good either
    Return _CompanyName
    End Get
    Set(value As String)
    _CompanyName = value
    End Set
    End Property
    Private _Country As String
    <Column(Storage:="_Country")> _
    Public Property Country As String
    Get
    Return _Country
    End Get
    Set(value As String)
    _Country = value
    End Set
    End Property
    Private Sub Customer_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    ' get a typed table on which to run queries
    customers = db.GetTable(Of Customer)()
    ' query for a list of countries
    Dim countriesquery As Object = From cust In customers Select cust.Country Distinct
    For Each cust As Object In countriesquery ' option strict ON disallows late binding so it must be OFF (see line 1)
    countryComboBox.Items.Add(cust.ToString)
    Next
    countryComboBox.SelectedIndex = 0
    End Sub
    Private Sub countryComboBox_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles countryComboBox.SelectedIndexChanged
    Dim query As Object = From cust As Customer In customers _
    Where cust.Country = countryComboBox.SelectedItem.ToString _
    Select cust
    resultsGrid.DataSource = query
    End Sub
    This code works as intended up to a point. It displays the countries in the comboBox as intended. Selecting a country then populates the DGV object "resultsgrid" with the customer items.  Problem is that the CompanyName column (and therefore
    the CompanyName values) are ABSENT from the grid.  Clearly the "Resultsgrid.Datasource = query" statement is not working correctly. 
    You can workaround the fault by replacing this statement with manually adding columns to the resultsgrid and then iterating over the query with a for each loop, adding a row on each iteration.  So the query is capturing all the data, including CompanyName. 
    But it begs the question: why is the CompanyName (among all the cust items) consistently missing from the resultsgrid when the datasource property statement is used?   What is so special about CompanyName?

    <
    Column(Storage:="_CompanyName")>
    PublicOverloadsPropertyCompanyName()
    AsString'
    doesn't appear in DGV.  It's a member of control base class.  Shadows doesn't help, though it should
    Get'
    because the name of the column in the db happens to be the same as this property of the Control class. Overloads no good either
    Return_CompanyName
    EndGet
    Set(value
    AsString)
                _CompanyName = value
    EndSet
    EndProperty
    Howard

  • Callling pl/sql function in BI DataModel Sql DataSet

    I'm creating a BI Data Model where the Data Set is a SQL query. The SQL query calls a pl/sql function.
    As a simple SQL query example:
    pl/sql pkg: test_utility function: GetRate
    select test_utility.GetRate(tc.code,'USD', sysdate)
    from test_currency tc
    Returns: ORA-01031: insufficient privileges
    Also the return variable is a number data type. Is this ok? Or does it have to be a boolean or varchar?
    Does this package need to be granted to a BI db role?
    Do I have to convert this pl/sql to used as a data template? seem a lot of workaround just to call a simple function...

    Which version of OBIEE using?
    if it is 11g ,there you have a facility to call procedure using Event Triggers.
    Also the return variable is a number data type. Is this ok? Or does it have to be a boolean or varchar? Yes return type should be BOOLEAN.
    Regards,
    Aravind

  • Hierarchical Linq to sql query

    I am querying 2 result sets and need to return a nested result set with specific fields.  What is the best way to filter the nested fields out of the query.
    Ex:
    Dim oBallotMeasures = From ballot In dc.sp_SelectBallotMeasures(Nothing, id)
    Group Join infoSources In dc.sp_SelectBallotMeasureInfo(Nothing, id)
    On ballot.Measure_Id Equals infoSources.Measure_Id
    Into MeasureInfo = Group
    Select ballot.Measure_id, ballot.Name, MeasureInfo
    MeasureInfo includes fields that I do not want to return.  How can I filter out some of the records, but keep the hierarchical structure?
    Desired result:
    [Measure_id: 1
    Name: Name 1
    MeasureInfo: [MeasureInfoName: 1
                        [MeasureInfoName: 2
    [Measure_id: 2
    Name: Name 2
    MeasureInfo: [MeasureInfoName: 1
                        [MeasureInfoName: 2
    Current result:
    [Measure_id: 1
    Name: Name 1
    MeasureInfo: [MeasureInfoName: 1
                         MeasureInfoOtherInfo: xyz
                        [MeasureInfoName: 2
                         MeasureInfoOtherInfo: xyz
    [Measure_id: 2
    Name: Name 2
    MeasureInfo: [MeasureInfoName: 1
                         MeasureInfoOtherInfo: xyz
                        [MeasureInfoName: 2
                         MeasureInfoOtherInfo: xyz
    Also, is there any easier way to create a hierarchical result set?
    RobertRFreeman

    Hello RobertRFreeman,
    From your description, it seems that your result sets will already be in local, so you could create DTO class to specify the returned column you want. For example,
    DTO classes:
    Public Class OrderDTO
    Property OrderID As Integer
    Property OrderName As String
    Property OrderDetailName As Object
    End Class
    Public Class OrderDetailDTO
    Property OrderDetailName As String
    End Class
    The LINQ query:
    Using db As DFDBEntities1 = New DFDBEntities1
    Dim result = (From o In db.Orders.ToList
    Group Join od In db.OrderDetails.ToList On o.OrderID Equals od.OrderID
    Into OOD = Group
    Select New OrderDTO With {
    .OrderID = o.OrderID,
    .OrderName = o.OrderName,
    .OrderDetailName = From oood In OOD
    Select New OrderDetailDTO With {.OrderDetailName = oood.OrderDetailName}}).ToList
    End Using
    It will return OrderID, OrderName and a collection which contains OrderDetailName column only I want. Please have a try and note this approach is used LINQ to Objects, while for using LINQ to Entities, unfortunately, the LINQ to Entities does not support
    such a cast.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Stok Program With WCF and linq to sql

    It runs on studio but it doesnt run on windows phone.I didnt add wcf,services and sql.Help Me ?

    Hi WHAT IS  MSDB 'S FULL MEAN,
    >>It runs on studio but it doesnt run on windows phone.I didnt add wcf,services and sql
    Do you mean that you can not add the WCF Service Reference?
    Are you using the Windows Phone Sivlerlight or the Windows Phone Runtime app?
    The Windows Phone 8.1 Rutime app does not support the "Add Services Reference", then we need to use the WCF Restful services for instead in Windows Phone 8.1 Rutime app, for more information, please try to refer to this blog:
    http://blogs.msdn.com/b/myamama/archive/2014/06/24/workaround-to-adding-service-reference-to-windows-phone-8-1-runtime-app.aspx
    Besides, for how to create a WCF Restful Service, please try to refer to this following article:
    http://www.codeproject.com/Articles/571813/A-Beginners-Tutorial-on-Creating-WCF-REST-Services .
    If I have misunderstood you, please try to describe more about your question and post the error information in here.
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Linq to SQL

    I am using vs2012 exp, and my operating sys is windows 8.1. sql server 2008 r2 devloper edition
    I want create a entity class . So i  Found Sqlmetal command line and when i used it gave me error that access to code file is denied.my database is on my sql server . 
    so I want to know how to create code file . my command line was as under
    sqlmetal /server:.\ /database:carrentals /code:Carrentals.vb /namespace:cars /pluralize /functions /sprocs /views 

    ask here: http://social.msdn.microsoft.com/Forums/en-US/home?forum=linqtosql
    post the exact error message when you ask. 
    Visual C++ MVP

  • SQLite Linq to SQL novice question

    Hello!
    I have a simple question about SQLite.
    I have small sample DB.
    CREATE TABLE table1 (
    name VARCHAR,
    surname VARCHAR
    I inserted 3 records via SQLite manager to this DB.
    Now I'd like to read and this DB in c#.
    public class SampleDB : DataContext
    public Table<Peoples> peoples;
    public SampleDB(string connection) : base(connection) { }
    [Table(Name = "table1")]
    public class Peoples
    [Column(Name = "Name")]
    public string Name { get; set; }
    [Column(Name = "Surname")]
    public string Surname { get; set; }
    class Program
    static void Main(string[] args)
    var connection = new SQLiteConnection(@"Data Source=d:\via\simple.sqlite");
    var context = new DataContext(connection);
    var peoples = context.GetTable<Peoples>();
    SampleDB db = new SampleDB(@"Data Source=d:\via\simple.sqlite");
    var query = from q in db.peoples
    where q.Name == "Alex"
    select q;
    Variable "Peoples" is working good. But "query" is not working. What's wrong with this code?
    Thanks.

    I think you're supposed to use a regular SQL query with SQLite.  I'm not a SQLite expert so I'm not sure. 
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • Java.sql.DataSet et al.

    I'm using derby (also in the jdk). What happened to the jdbc4 features that were part of Mustang, they are absent in jdk1.6.

    When you say using the JDK you mean just using a simple text editor and command line to compile?
    I'm not too bothered about decompilation as I doubt anyone would go though the effort to decompile this particular program. As it currently stands I'm the only one known in my college class to try my hand at Java anyway. Anyone else handing a java project in would be very suspicious.
    How big would the program be if the JVM was included? Is it an intricate process to combine the two?
    I am aware that any code can be decompiled but e.g. VB programs can only be decompiled into assembly... atleast I have yet to see a proper VB decompiler in action.
    The app.path Java equivelant I need so the files needed by the program which should be in the same directory can be found with ease.
    What compiler did JBuilder come with? It's own or did they simply include Sun's?
    Whats the general opinion of V J++? is it pretty much Java or has M$ screwed it over and turned it into their own?
    When an argument is passed to a method in Java is it referenced in memory or is a copy created? How do I pass an array to a method? and not create a copy of it? ref?
    Can applets perform read and write actions on the machine it is stored? Can I refuse connections if a client is already connected?
    Thanx

Maybe you are looking for

  • IPhoto lost pictures from library

    Greetings all. I'm running OSX 10.9.2 and iPhoto 9.5.1 I do regular back ups and when I updated 2 days ago and then opened up iPhoto there are only a few seemingly random pictures left. Upon searching my computer with finder for .jpg files I can find

  • No sound after Windows 8 update on HP Pavilion G6

    Hi, After updating Windows8 to 8.1 on my HP Pavilion G6-2235TX laptop i have no sound. I have followed instructions posted on this forum and had no luck getting the sound to work. I have tried updating to a couple of different drivers SP59649 & SP585

  • Multiple logons using same Logon Manager Splash Screen

    I have an web application set up in Logon Manager where the user profile is set to login as a simple user with matching credentials. I also want the person to login to the same web page at the same login splash screen using different credentials as a

  • XMLTYPE(CURSOR)

    Hi ! SELECT XMLTYPE(CURSOR(SELECT SYSDATE FROM DUAL)) FROM DUAL; XMLTYPE(CURSOR(SELECTSYSDATEFROMDUAL)) <?xml version="1.0"?> <ROWSET> <ROW>   <SYSDATE>09-MAY-2008</SYSDATE> </ROW> </ROWSET>The date is in NLS format, when a XML format is expected Reg

  • I cannot set up my Cannon MG6250 printer to use air-print?

    Can anyone suggest why this setup does not work please. I've checked on compatability on the Apple website and ethey arecompatable. Thanks.