Linq to sqlÔöɾ¸Ä²é
private void button2_Click(object sender, EventArgs e)//Ôö
{
try
{
Customers ct = new Customers();
ct.CustomerID = "test";
ct.CompanyName = "test";
NorthwindDataContext nc = new NorthwindDataContext();
nc.Customers.InsertOnSubmit(ct);
nc.SubmitChanges();
MessageBox.Show("¸üгɹ¦");
}
catch (Exception e1)
{
MessageBox.Show(e1.ToString());
}
}
private void button3_Click(object sender, EventArgs e)//²é
{
NorthwindDataContext nt = new NorthwindDataContext();
var a = from s in nt.Customers where s.CustomerID == "test" select new {s.CompanyName,s.ContactName,s.ContactTitle };
foreach (var b in a)
{
MessageBox.Show(b.ToString());
}
}
private void button4_Click(object sender, EventArgs e)//¸Ä
{
try
{
NorthwindDataContext nw = new NorthwindDataContext();
var cityNameQuery =
from cust in nw.Customers
where cust.City.Contains("London")
select cust;
foreach (var customer in cityNameQuery)
{
if (customer.City == "London - Metro")
{
customer.City = "London";
}
}
nw.SubmitChanges();
MessageBox.Show("³É¹¦");
}
catch (Exception e1)
{
MessageBox.Show(e1.ToString());
}
}
private void button5_Click(object sender, EventArgs e)//ɾ
{
NorthwindDataContext nw = new NorthwindDataContext();
var a = from s in nw.Customers where s.CustomerID == "jj
Ïà¹ØÎĵµ£º
sql group by Ó÷¨
2009-07-16 11:01:00 Òµ½ç | ÆÀÂÛ(0) | ä¯ÀÀ(1676)
group byÖ÷ÒªÊÇÓÃÀ´·Ö×éµÄ£¬Ôõô¸ö·Ö×éÄØ£¿
ÒÔÏÂÓÃÁ½¸öÀý×Ó˵Ã÷Á½¸öʹÓ÷½Ã棬1ÊǺÏÀíµÄ·µ»ØºÏ¼ÆÖµ£¨·ÀÖ¹µÑ¿¨¶û»ýÏÖÏ󣩣¬2ÊÇÓ÷Ö×éÀ´ÕÒ³öÖظ´µÄ¼Ç¼
============================================================== ......
Microsoft SQL Server£¨ÒÔϼò³ÆSQL Server£©×÷ΪһÖÖÖÐСÐÍÊý¾Ý¿â¹ÜÀíϵͳ£¬ÒѾµÃµ½Á˹㷺µÄÓ¦Ó㬸Ãϵͳ¸üÇ¿µ÷ÓÉϵͳÀ´¹ÜÀíËø¡£ÔÚÓû§ÓÐSQLÇëÇóʱ£¬ÏµÍ³·ÖÎöÇëÇó£¬×Ô¶¯ÔÚÂú×ãËø¶¨Ìõ¼þºÍϵͳÐÔÄÜÖ®¼äΪÊý¾Ý¿â¼ÓÉÏÊʵ±µÄËø£¬Í¬Ê±ÏµÍ³ÔÚÔËÐÐÆڼ䳣³£×Ô¶¯½øÐÐÓÅ»¯´¦Àí£¬ÊµÐж¯Ì¬¼ÓËø¡£
¡¡¡¡¶ÔÓÚÒ»°ãµÄÓû§¶øÑÔ£¬Í¨¹ýϵͳµÄ× ......
ϱí˵Ã÷ÔÚ Microsoft SQL Server Êý¾Ý¿âÖж¨ÒåµÄ£¬»òÔÚ Transact-SQL
Óï¾äÖÐÒýÓõĸ÷ÖÖ¶ÔÏóµÄ×î´óÖµ£¨ÊýÁ¿»ò´óС£©¡£ÏÂ±í²»°üº¬ Microsoft® SQL Server 2000™ Windows® CE °æ¡£
×î´óÖµ£¨ÊýÁ¿»ò´óС£©
¶ÔÏó
SQL Server 7.0
SQL Server 2000
Åú´¦Àí´óС
65,536 * ÍøÂçÊý¾Ý°ü´óС1
65,536 * Í ......