ÓÐÈýÕűí LP_COMPANY, LP_COMPANYTYPE,LP_APPLICATION
SQLÓï¾äÊÇ
SELECT b.appname,c.typename,a.ID, a.APPID, a.PROVID, a.CITY, a.DISTRICT, a.TYPEID, a.PARENTID,
a.COMNAME, a.CHARGER, a.LICENSE, a.OPENBANK, a.ACCOUNT, a.NATAXNO, a.LOTAXNO,
a.STATUS, a.MEMO, a.ADDDATE, a.ADDTIME, a.REMARK1, a.REMARK2, a.REMARK3, a.REMARK4
from LP_COMPANY a
left join lp_application b on a.appid=b.id left join lp_companytype c on a.typeid=c.id
ÁíÍâÐè×¢ÒâµÄÊÇ
ÏîÄ¿ËùÓÿò¼ÜÊÇ struts2+spring2+ibatis2
¹ÊÔÚcompanyµÄbeanºÍactionÖÐ ¼ÓÈëÁ½¸öÊôÐÔtypeName ºÍappName ......
linq×î½üÔ½À´Ô½»ð ´ÓÍøÉÏ¿´ÁËÏà¹Ø½Ì³Ì
ÊÔ×ÅдÁËһЩ¶«Î÷£¡
ÏÂÃæÊÇÒ»¸ö¼òµ¥µÄÔöɾ¸Ä²é¹¦ÄÜ£¡£¡£¡
Àà:
ÏÂÃæÊǶÔÕâ¸ö±í½øÐвÙ×÷ÁË
Ìù´úÂë:
public class LinqTosql
{
public static GameCardSaleDataContext data = new GameCardSaleDataContext();
//Êä³öÐÂÎűíËùÓбêÌâ
public void output()
{
foreach (var item in data.News)
{
Console.WriteLine(item.Title);
}
}
//¸ù¾ÝID²éѯһÌõÊý¾Ý
public void selectbyId(int id)
{
IEnumerable<News> query = from m in data.News
where m.NewsId == id
select m;
foreach (News item in query)
{
Console.WriteLine(item.Content);
}
}
//²åÈëÒ»ÌõÊý¾Ý ·µ»ØÖ÷¼ü×ÔÔöÁÐID
public int Insert(News news)
{
data.News.InsertOnSubmit(news);
data.SubmitChanges();
......
¹ØÓÚDBAµÄ½ÇÉ«
Éú²úDBA
ÊôÓÚ´«Í³DBA½ÇÉ«£¬Êǹ«Ë¾µÄ‘±£µ¥’£¬È·±£Éú²úÊý¾Ý²»»á³ö´í¡£»¹¸ºÔðÈ·±£·þÎñÆ÷Ò»×îÓÅ»¯µÄ·½Ê½ÔËÐУ¬²¢´Ù½øÊý¾Ý¿â´Ó¿ª·¢ÆÚתµ½QAÔÙתµ½Éú²ú¡£
Éú²úDBAµÄÆäËûһЩ½ÇÉ«°üÀ¨ÒÔÏ·½Ã棺
1£© °²×°SQL Server ʵÀýºÍ²¹¶¡°ü¡£
2£© ¼àÊÓÐÔÄÜÎÊÌâ¡£
3£© °²×°À´×Ô¿ª·¢ÈËÔ±µÄ½Å±¾¡£
4£© ½¨Á¢ÐÔÄÜÖ¸±êµÄ»ù×¼¡£
5£© ÓÅ»¯ÅäÖÃSQL Server.
6£© ½¨Á¢ÔÖÄѻָ´ºÍÉìËõÐԼƻ®¡£
7£© È·±£±¸·ÝÕý³£ÔËÐС£
ÔÚ´óÐ͵¥Î»ÖУ¬Éú²úDBA¿ÉÄÜÊôÓÚÔËÓª²¿ÃÅ£¬½«Éú²úDBA·Å½ø¿ª·¢Ð¡×éÖн«Ê¹µÃÎÞ·¨ÊµÏÖÓÉÓÚ·¨¹æÔÒòËùÐèµÄȨÏÞ·ÖÀë¡£Ëü´´½¨Ò»ÖÖ»·¾³:¿ª·¢ÈËÔ±Ëù×÷µÄÐÞ¸ÄÁ¢¼´Ó¦Óõ½Éú²ú»·¾³ÖУ¬¶øÇÒûÓнøÐÐÊʵ±µÄ¼ì²éºÍÉóºË¡£
¿ª·¢DBA
ËûÃÇÊÇ¿ª·¢ÈËÔ±µÄÊý¾Ý¿âר¼ÒºÍ´ú±í£¬È·±£ËùÓд洢¹ý³Ì¶¼ÒÔ×îÓÅ·½Ê½±àд£¬²¢È·±£Êý¾Ý¿âÔÚÎïÀíºÍÂß¼É϶¼ÕýÈ·½¨Ä£¡£»¹¸ºÔðǨÒƹý³Ì£¬
¿ª·¢DBAµÄÆäËûһЩ½ÇÉ«°üÀ¨ÒÔÏ·½Ã棺
1£© Ó¦ÓÃÊý¾Ý¿â½¨Ä£¡£
2£© ´´½¨´æ´¢¹ý³Ì¡£
3£© ¿ª·¢Éú²úDBAʹÓõĸü¸Ä½Å±¾¡£
4£© ¶Ô²éѯºÍ´æ´¢¹ý³Ì½øÐÐÐÔÄÜÓÅ»¯¡£
5£© ¿ÉÄÜ´´½¨ÈκαØÒªµÄÊý¾ÝǨÒÆ¡£
6£© ×÷ΪÉú²úDBAµÄÒ»¸ ......
using (DataClasses1DataContext a = new DataClasses1DataContext())
{
}
ÕâÑùд±È½Ï·½±ã
¸üÐÂʱ,Èç¹û±íûÓÐÖ÷¼ü,ÄDz»»á¸üÐÂ,Ò²²»»á±¨´í,ÉèÁËÖ÷¼üºó,ÖØ¿ªÁ¬½Ó,ÖØÐÂÍÏÒ»¸öµ½ContextÀïÃæ
Èç¹û±íµÄÓ³ÉäÀ಻ÊÇ´ÓcontextÀïÃæËѳöÀ´µÄ,¶øÊÇ×Ô¼ºnewµÄ
ÓÃcontext.±íÀà.Attach(ÍâÃæµÄÀà,true/false)¸üР......
µ¼³ö±í½á¹¹:
Tools-->Export User Objects -->Ñ¡ÔñÒªµ¼³öµÄ±í(°üÀ¨SequenceµÈ)-->.sqlÎļþ
µ¼³ö±íÊý¾Ý:
Tools-->Export Tables-->Ñ¡Ôñ±í,Ñ¡ÔñSQL Inserts-->.sqlÎļþ
Ö´ÐÐÕâЩ.sqlÎļþʱ,ҪʹÓÃн¨Command WindowÀ´Ö´ÐÐ. ......
ʵ¼ÊÓ¦ÓÃÖУ¬ÎÒÃǾ³£ÐèÒª°ÑExcelÖеÄÊý¾Ýµ¼ÈëMS SQL Server »òMySQL OracleµÈÊý¾Ý¿âÖС£ÕâЩÊý¾Ý¿â¶¼ÌṩÁ˺ܺõŤ¾ß¹©Óû§Ö±½Ó½«ExcelÖеÄÊý¾Ýµ¼ÈëÊý¾Ý¿âÖС£µ«ÊǺܶàʱºòÎÒÃDz¢²»ÄÜÖ±½Ó²Ù×÷Êý¾Ý¿â¹ÜÀíÆ÷£¨ÒòΪ°²È«ÐèÒª»áÅäÖ÷À»ðǽÀ¹½ØÊý¾Ý¿â¶Ë¿Ú£©£¬ÎÒÃÇÖ»ÄÜͨ¹ýwebÒ³Ãæ¶ÔÊý¾Ý¿â½øÐÐÔ¶³Ì²Ù×÷¡£Õâ¸öʱºò£¬½«ExcelÖеÄÊý¾Ýת»»³Ésql InsertÓï¾ä¾Í·Ç³£ÓбØÒªÁË¡£
Àý×Ó£º±í¸ñÖÐÓÐA¡¢B¡¢CÈýÁÐÊý¾Ý£¬Ï£Íûµ¼Èëµ½Êý¾Ý¿âusers±íÖУ¬¶ÔÓ¦µÄ×ֶηֱðÊÇname,sex,age ¡£ÔÚÄãµÄexcel±í¸ñÖÐÔö¼ÓÒ»ÁУ¬ÀûÓÃexcelµÄ¹«Ê½×Ô¶¯Éú³ÉsqlÓï¾ä£¬·½·¨ÈçÏ£º
Ôö¼ÓÒ»ÁУ¨DÁУ©
2¡¢ÔÚµÚÒ»ÐеÄDÁУ¬¾ÍÊÇD1ÖÐÊäÈ빫ʽ£º =CONCATENATE("insert into users (name,sex,age) values ('",A1,"','",B1,"','",C1,"');")
3¡¢´ËʱD1ÒѾÉú³ÉÁËÈçϵÄsqlÓï¾ä£º insert into users (name,sex,age) values ('ls','Å®','24');
4¡¢½«D1µÄ¹«Ê½¸´ÖƵ½ËùÓÐÐеÄDÁÐ
5¡¢´ËʱDÁÐÒѾÉú³ÉÁËËùÓеÄsqlÓï¾äÓÑÉÌÉçÇø.
6¡¢°ÑDÁи´ÖƵ½Ò»¸ö´¿Îı¾ÎļþÖС£
×¢Ò⣺Éú³ÉµÄinsertÓï¾äÖÐÓÐÒ»¸öÌØÊâ×Ö·û"?"£¬ÐèҪת»»³É¿Õ¸ñ¡£ÍƼöʹÓÃUltraEdit½øÐд¦Àí¡£ ......