1.
<connectionStrings>
2.
<add name=
"TestDB My.MySettings.TestDBConnectionString"
connectionString=
"Data Source=.\SQLExpress;Initial Catalog=TestDB ;Integrated Security=True"
3.
providerName=
"System.Data.SqlClient"
/>
4.
</connectionStrings>
Imports
System.Linq
System.IO
Public
Class
ConDataClass
Dim
filename
As
String
=
"conn.text"
5.
(ส่วนนี้ก็ทำการเขียนฟังก์ชันการเชื่อมต่อเลยครับ)
6.
End
public
static
string
strConn = File.ReadAllText(@
"Connect.txt"
);
Quote:คือผมสร้าง Text File แล้วใส่ไว้ใน Bin
Quote:แต่ตัวนี้ผมใช้ LINQ แล้ว เขียน connectionString= File.ReadAllText(@"Connect.txt)
01.
ผมก็จะสร้าง
class
มาตัวหนึ่ง
02.
using
System;
03.
System.Collections.Generic;
04.
System.Linq;
05.
System.Text;
06.
System.IO;
07.
08.
namespace
MiniSale.Class
09.
{
10.
DBConnString
11.
12.
"ConnectSQL.txt"
13.
UserName =
""
;
14.
}
15.
xmlFolder =
.Format(
"{0}\\xml"
, Application.StartupPath);
if
(!Directory.Exists(xmlFolder))
Directory.CreateDirectory(xmlFolder);
xmlPath =
"{0}\\xml\\myXml.xml"
, System.Windows.Forms.Application.StartupPath);
IEnumerable<XElement> unmatch = from xu
in
XElement.Load(xmlPath).Elements(
"อิอิ"
)
select xu;
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง