TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
bafana mthivane
NA
10
2.7k
add using linq c#
Jun 12 2014 3:01 AM
#####Presentation
private void Grid_Loaded_1(object sender, RoutedEventArgs e) // load list box with a value or name of sorts
{
var getResults = data.LoadShip();
lsShipper.ItemsSource = getResults;
lsShipper.DisplayMemberPath = "CompanyName";
lsShipper.SelectedValuePath = "ShipperID";
txtShip.IsEnabled = false;
txtCompanyName.IsEnabled = false;
txtPhone.IsEnabled = false;
}
private void lsShipper_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
var getResults = data.ReturnString(Convert.ToInt32(lsShipper.SelectedValue));
foreach (var item in getResults) //binding to textbox
{
txtShip.Text = item.ShipperID.ToString();
txtCompanyName.Text = item.CompanyName;
txtPhone.Text = item.Phone;
}
###DataTier
public DataTable ExcelCustomer() //SELECT USING A JOINT STATEMENT
{
var query = from qry in data.Territories
join qrys in data.Regions
on qry.RegionID equals qrys.RegionID
orderby qry.RegionID
select new
{
qry.Employees,
qry.RegionID,
qry.Region,
qrys.Territories,
qrys.RegionDescription
};
DataTable dt = new DataTable();
dt.Columns.Add("Employees");
dt.Columns.Add("RegionID");
dt.Columns.Add("Region");
dt.Columns.Add("Territories");
dt.Columns.Add("RegionDescription");
foreach (var qry in query)
{
dt.NewRow();
dt.Rows.Add(qry.Employees, qry.RegionID, qry.Region, qry.Territories, qry.RegionDescription);
}
return dt;
}
public IEnumerable<NorthClass.Shipper> ReportShip() //LOADING A LISTBOX
{
var query = from qry in data.Shippers
select qry;
return query.ToList();
}
public IEnumerable<object> strString(int Ship) //RECIEVE AND LOAD TEXTBOX
{
var query = from qry in data.Suppliers
where qry.SupplierID.Equals(Ship)
select qry;
return query.ToList();
}
}
Reply
Answers (
5
)
C# Problem
xml using c#