Asp.net visual studio 2012中缺少按钮
当我在Visual Studio 2012中处理asp.net页面时,我的设计和拆分按钮丢失了。我只有消息来源。我怎样才能把这些拿回来。看看窗户的底部。 看看这个问题: 如果它们不存在,请启用它们:Asp.net visual studio 2012中缺少按钮,asp.net,visual-studio-2012,Asp.net,Visual Studio 2012,当我在Visual Studio 2012中处理asp.net页面时,我的设计和拆分按钮丢失了。我只有消息来源。我怎样才能把这些拿回来。看看窗户的底部。 看看这个问题: 如果它们不存在,请启用它们: //1. 检索客户名称并按字母顺序显示在列表框中 私有无效按钮\u单击(对象发送者,路由目标e) { DataClasses1DataContext db=新DataClasses1DataContext(); var query=来自数据库中的c.Customers orderby c.Con
//1. 检索客户名称并按字母顺序显示在列表框中
私有无效按钮\u单击(对象发送者,路由目标e)
{
DataClasses1DataContext db=新DataClasses1DataContext();
var query=来自数据库中的c.Customers
orderby c.ContactName升序
选择c.ContactName;
lbxDisplay.ItemsSource=query.ToList();
}
//2.(a)左侧一个显示供应商名称。
私有void GetData2_单击(对象发送方,路由目标)
{
DataClasses1DataContext db=新DataClasses1DataContext();
var query=来自数据库中的供应商
选择s.CompanyName;
lbx1.ItemsSource=query.ToList();
lbx1.SelectedIndex=0;
}
//(b) 当在此列表中选择名称时,此供应商的产品将显示在右侧
私有无效lbx1_SelectionChanged(对象发送方,SelectionChangedEventArgs e)
{
DataClasses1DataContext db=新DataClasses1DataContext();
字符串companyName=lbx1.SelectedValue.ToString();
var query2=来自数据库中的供应商
在db.Products中加入p
关于s.SupplierID等于p.SupplierID
其中s.CompanyName==CompanyName
选择p.ProductName;
lbx2.ItemsSource=query2.ToList();
}
//3. 选择以下产品信息并显示在DataGrid上
//产品名称//供应商名称//单价
私有void GetData3_单击(对象发送方,路由目标)
{
DataClasses1DataContext db=新DataClasses1DataContext();
var query3=来自数据库中的供应商
在db.Products中加入p
关于s.SupplierID等于p.SupplierID
选择新的
{
Name=s.CompanyName,
Product=p.ProductName,
价格=单价
};
dDisplay3.ItemsSource=query3.ToList();
}
//4. 首先显示客户ID和按最高订单数排序的订单数
//使用Orderby
私有void GetData4_单击(对象发送方,路由目标)
{
DataClasses1DataContext db=新DataClasses1DataContext();
var query4=以db.为单位从o开始
在db.Order\U详细信息中加入od
在o.OrderID上等于od.OrderID
按od排序。数量递减
选择新的
{
CustomerId=o.CustomerId,
NumberofOrders=外径数量,
};
dDisplay4.ItemsSource=query4.ToList();
}
//5. 按订单数量显示订单和客户表中的以下信息
//客户ID//公司名称//订单数量//联系人姓名//联系电话
//提示:使用Group和Join
private void GetData5_单击(对象发送方,路由目标)
{
DataClasses1DataContext db=新DataClasses1DataContext();
var query5=以db.为单位从o开始
按o.CustomerID将o分组为g
在数据库中加入c。客户在g上。Key等于c.CustomerID
orderby g.Count()降序
选择新的
{
CustomerId=g.键,
CompanyName=c.CompanyName,
OrderCount=g.Count(),
ContactName=c.ContactName,
ContactPhone=c.电话
};
dgDisplay5.ItemsSource=query5;
}
}//末级
您应该在SuperUsers上询问这是一个web表单项目还是一个MVC项目?
<TabControl TabStripPlacement="Top">
<TabItem Header="Ex1" Width="100">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="129*"/>
<ColumnDefinition Width="23*"/>
<ColumnDefinition Width="355*"/>
</Grid.ColumnDefinitions>
<Button Content="Get Data" HorizontalAlignment="Left" Margin="61,22,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click" Grid.Column="2"/>
<ListBox Name="lbxDisplay" HorizontalAlignment="Left" Height="195" Margin="24,59,0,0" VerticalAlignment="Top" Width="456" Grid.ColumnSpan="3"/>
</Grid>
</TabItem>
<TabItem Header="Ex2" Width="100">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="22*"/>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="465*"/>
</Grid.ColumnDefinitions>
<Button Content="GetData2" Name="GetData2" HorizontalAlignment="Left" Margin="171,22,0,0" VerticalAlignment="Top" Width="75" Click="GetData2_Click" Grid.Column="2"/>
<ListBox Name="lbx1" HorizontalAlignment="Left" Height="195" Margin="2,59,0,0" VerticalAlignment="Top" Width="209" Grid.Column="1" Grid.ColumnSpan="2" SelectionChanged="lbx1_SelectionChanged" />
<ListBox Name="lbx2" HorizontalAlignment="Left" Height="195" Margin="233,59,0,0" VerticalAlignment="Top" Width="207" Grid.Column="2"/>
</Grid>
</TabItem>
<TabItem Header="Ex3" Width="100">
<Grid Margin="9,14,16,28">
<Button Content="Get Data3" Name="GetData3" HorizontalAlignment="Left" Margin="213,22,0,0" VerticalAlignment="Top" Width="75" Click="GetData3_Click"/>
<DataGrid Name="dgDisplay3" Margin="0,51,0,0" RenderTransformOrigin="0.5,0.5" >
<DataGrid.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform AngleX="1.193"/>
<RotateTransform/>
<TranslateTransform X="-1.479"/>
</TransformGroup>
</DataGrid.RenderTransform>
</DataGrid>
</Grid>
</TabItem>
<TabItem Header="Ex4" Width="100">
<Grid>
<Button Content="Get Data" Name="GetData4" HorizontalAlignment="Left" Margin="213,22,0,0" VerticalAlignment="Top" Width="75" Click="GetData4_Click"/>
<DataGrid Name ="dgDisplay4" Margin="10,62,10,10"></DataGrid>
</Grid>
</TabItem>
<TabItem Header="Ex5" Width="100">
<Grid>
<Button Content="Get Data" Name="GetData5" HorizontalAlignment="Left" Margin="213,22,0,0" VerticalAlignment="Top" Width="75" Click="GetData5_Click"/>
<DataGrid Name ="dgDisplay5" Margin="10,62,10,10"></DataGrid>
</Grid>
</TabItem>
</TabControl>
//1. Retrieve customer names and display alphabetically in a listbox
private void Button_Click(object sender, RoutedEventArgs e)
{
DataClasses1DataContext db = new DataClasses1DataContext();
var query = from c in db.Customers
orderby c.ContactName ascending
select c.ContactName;
lbxDisplay.ItemsSource = query.ToList();
}
//2.(a) One on left displays supplier name.
private void GetData2_Click(object sender, RoutedEventArgs e)
{
DataClasses1DataContext db = new DataClasses1DataContext();
var query = from s in db.Suppliers
select s.CompanyName;
lbx1.ItemsSource = query.ToList();
lbx1.SelectedIndex = 0;
}
//(b) When a name is selected on this list the products for this supplier are displayed on the right
private void lbx1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
DataClasses1DataContext db = new DataClasses1DataContext();
string companyName = lbx1.SelectedValue.ToString();
var query2 = from s in db.Suppliers
join p in db.Products
on s.SupplierID equals p.SupplierID
where s.CompanyName == companyName
select p.ProductName;
lbx2.ItemsSource = query2.ToList();
}
//3. Select the following product information and display on a DataGrid
//Product Name //Supplier Name //Unit Price
private void GetData3_Click(object sender, RoutedEventArgs e)
{
DataClasses1DataContext db = new DataClasses1DataContext();
var query3 = from s in db.Suppliers
join p in db.Products
on s.SupplierID equals p.SupplierID
select new
{
Name = s.CompanyName,
Product = p.ProductName,
Price = p.UnitPrice
};
dgDisplay3.ItemsSource = query3.ToList();
}
//4. Display Customer ID and Number of Orders sorted with highest number of orders first
//using Orderby
private void GetData4_Click(object sender, RoutedEventArgs e)
{
DataClasses1DataContext db = new DataClasses1DataContext();
var query4 = from o in db.Orders
join od in db.Order_Details
on o.OrderID equals od.OrderID
orderby od.Quantity descending
select new
{
CustomerId = o.CustomerID,
NumberofOrders = od.Quantity,
};
dgDisplay4.ItemsSource = query4.ToList();
}
//5. Display the following information from the Orders and Customer tables ordered by count of orders
// Customer ID // Company Name // Number of Orders // Contact Name // Contact Phone
//Hint: Use Group and Join
private void GetData5_Click(object sender, RoutedEventArgs e)
{
DataClasses1DataContext db = new DataClasses1DataContext();
var query5 = from o in db.Orders
group o by o.CustomerID into g
join c in db.Customers on g.Key equals c.CustomerID
orderby g.Count() descending
select new
{
CustomerId = g.Key,
CompanyName = c.CompanyName,
OrderCount = g.Count(),
ContactName = c.ContactName,
ContactPhone = c.Phone
};
dgDisplay5.ItemsSource = query5;
}
}//end class