score:1
suposing your artist have a name and an id, you can do this:
combobox1.datavaluefield = "id";
combobox1.datatextfield = "name";
combobox1.datasource = formbyartist.db.artists;
combobox1.databind();
score:1
from your existing sample, modify as follows:
var artistnames =
(from name in formbyartist.db.artists
select name.name)
.tolist();
combobox1.datasource = artistnames;
Source: stackoverflow.com
Related Query
- Populating ComboBox Items with members from a dynamic database, C#
- Can't add a new record with an integer value into database by using linq from code C#
- get selected value from combobox with data source is anonymous type
- Populating a page with data from a database in mvc 5
- Querying Dynamic Category /Sub Category from database with Entity Framework and LINQ
- Entity Framework dynamic linq where from generic source with dynamic where clause
- Remove items of list from another lists with criteria
- How can I set properties on all items from a linq query with values from another object that is also pulled from a query?
- How do I select items from an array using an array of indices with Linq?
- Dynamic LINQ query to get Field value from Database
- Retrieving an image from database with Linq to SQL
- Create a nested list of items from objects with a parent reference
- Group items and select specific item from each group with LINQ
- C# Code Contracts -- How to ensure that a collection of items contains items with unique properties?
- Removing a single item from an enumerable source when the items are equal
- how to show image from database in asp:image with linq?
- How get database table name with schema name from entity programmatically
- How to Deal With Dapper return Key Value pair with Dynamic from LINQ
- Retrieve and print data from dynamic sql query with linq
- C#: How to remove items from the collection of a IDictionary<E, ICollection<T>> with LINQ?
- C#- Select specific items from a list based on partial intersection with another list (Linq + Lambda)
- Populate StackPanel with checkbox's from Database
- Using Linq to return the count of items from a query along with its resultset
- Select Distinct Row from Data Table with Dynamic Columns
- creating Linq to sqlite dbml from DbLinq source code
- C# WPF delete item with its primary key from database using datagrid
- LINQ - Is it possible with dynamic LINQ to dynamically specify the from clause?
- Get items from input list that do not exist in the database using EF Core 2.1
- Get Min and Max for items from database using Linq
- How do I get values from SelectedItem in ComboBox with Linq and C# 3.5
More Query from same tag
- How to compare IEnumerable<string> for null in Linq query
- C# - How to loop back around after assigning integer IDs from a collection?
- Entity Framework right join to fill user settings
- Use LINQ to convert comma separated strings in a table into a distinct collection of values
- Sql to Linq transformation
- Join two tables issue in linq
- Finding strings that are not in DB already
- Where does the Northwnd come from in MS's Linq documentation?
- Converting SQL Server query into linq
- LINQ query in C# using group and join
- Linq statement returns null
- C# how get maximum value from list of lists
- How does LINQ-To-SQL prevent SQL-Injections?
- LINQ query to filter page results
- Remove Duplicate Rows and Count in C# DataTable
- How to join tables in EF LINQ
- How to incorporate criteria in Where method?
- Casting back query results stored in session for Custom Authorization
- compare none value by linq
- Change variable in linq
- Entity Framework extension method ICollection / IQueryable
- How to add an element as the n child to an element in LINQ
- Creating a LINQ select from multiple tables
- How to convert List<string> to xml
- How to set value from different table columns?
- Entity Framework/LINQ - Returning data transfer objects from a large nested entity data set
- C#: Remove duplicate values from dictionary?
- linq Group By from DataTable
- LINQ GROUP BY and MAX()
- How to filter records on a string date column using entity framework