========================================================================================== C# ========================================================================================== <C#> =LINQ TO DATASET :VAR // Fill the DataSet. -클라우드 READER + ADAPTER( XML로 바꿔 줌) => 망고 DB ( 클라우드의 자원 사용 안하는 방향으로 ) = 찾기 리스트박스 (id)-primary key 이름 EMAIL 전화번호 핸드폰번호 주소 회사/학교 부서/과 소개 앞으로 뒤로 추가 수정 삭제 -DB mysql> create table myfriend( -> id int, -> name varchar(20), -> email varchar(20), -> phone varchar(20), -> mobile varchar(20), -> address varchar(20), -> company varchar(20), -> department varchar(20), -> introduce varchar(80) -> ); Query OK, 0 rows affected (0.24 sec) mysql> alter table myfriend add primary key(id); Query OK, 0 rows affected (0.42 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> alter table myfriend drop primary key; Query OK, 0 rows affected (0.41 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> alter table myfriend drop id; Query OK, 0 rows affected (0.25 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> alter table myfriend add id int not null auto_increment primary key; Query OK, 0 rows affected (1.04 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> alter table myfriend modify column id int first; Query OK, 0 rows affected (0.42 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> DESC MYFRIEND; +------------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+-------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | name | varchar(20) | YES | | NULL | | | email | varchar(20) | YES | | NULL | | | phone | varchar(20) | YES | | NULL | | | mobile | varchar(20) | YES | | NULL | | | address | varchar(20) | YES | | NULL | | | company | varchar(20) | YES | | NULL | | | department | varchar(20) | YES | | NULL | | | introduce | varchar(80) | YES | | NULL | | +------------+-------------+------+-----+---------+----------------+ 9 rows in set (0.00 sec) = ========================================================================================== C++ ========================================================================================== <C++> =템플릿 클래스 내의 static 변수 #include <iostream> =static 변수의 특수화 #include <iostream> =컨테이터 ( STL )
DataSet ds = new DataSet();
ds.Locale = CultureInfo.InvariantCulture;
FillDataSet(ds);
DataTable products = ds.Tables["Product"];
IEnumerable<DataRow> productsQuery =
from product in products.AsEnumerable()
select product;
IEnumerable<DataRow> largeProducts =
productsQuery.Where(p => p.Field<string>("Size") == "L");
Console.WriteLine("Products of size 'L':");
foreach (DataRow product in largeProducts)
{
Console.WriteLine(product.Field<string>("Name"));
}
using namespace std;
template <class T>
class smart
{
public:
static T num;
};
template <typename T>
T smart<T>::num;
int main()
{
smart<int> obj1;
cout << obj1.num << endl;
return 0;
}
using namespace std;
template <class T>
class smart
{
public:
static T num;
};
template <typename T>
T smart<T>::num;
template <>
int smart<int>::num = 100;
int main()
{
smart<int> obj1;
smart<short> obj2;
cout << obj1.num << endl;
cout << obj2.num << endl;
return 0;
}