พีเอ็ม คอม แหล่งรวบรวมสาระความรู้ แบ่งปัน และน้ำใจ ในการให้ความรู้ทางด้านคอมพิวเตอร์ อยากรู้อะไรเข้ามาสอบถามได้เลย โปรแกรมฟรี Open Source และอื่น ๆ อีกมากมาย
02 เมษายน 2557
ใช้ Database ตัวใหนดี (VB.NET)
'Imports System.Data.Odbc
'Provider มําตรฐานใน ADO.NET ส ําหรับ.NET Framework 2.0 ใน .NET Framework 2.0
'Imports System.Data.SqlClient 'Microsoft SQL Server 7.0 ขึ้นไป
'Imports System.Data.OracleClient 'Oracle 8.1.6 ขึ้นไป
'Imports System.Data.SqlXml 'SqlXml ใน SQL Server
'Imports System.Data.Odbc 'ODBC DataSource
'Imports System.Data.OleDb 'OleDb
'------------------------------------------------------------------------------
'MySQL Connction String
'Standard
'Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
'Specifying port
'Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
'Named pipes
'Server=myServerAddress;Port=-1;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
'Multiple servers
'Server=serverAddress1 & serverAddress2 & etc..;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
'Using encryption
'Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;Encryption=true;
'Using encryption, alternative
'Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;Encrypt=true;
'Specifying default command timeout
'Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;default command timeout=20;
'Specifying connection attempt timeout
'Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;Connection Timeout=5;
'Inactivating prepared statements
'Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;Ignore Prepare=true;
'Specifying port
'Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;Port=3306;
'Specifying network protocol
'Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword; Protocol=socket;
'Specifying character set
'Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword; CharSet=" & MySqlCharSet & ";
'Specifying shared memory name
'Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;Shared Memory Name=MYSQL;
'Imports System.Data
'Imports System.Data.SqlClient
Imports System.Data.Odbc
การแก้ปัญหา InavlidOperationExeception was unhandled by user code (VB.NET)
เกิดปัญหาเมื่อเราส่ง ReportProgress ไป ดังนี้ ครับ
"InavlidOperationExeception was unhandled by user code"
This BackgroundWorker states that it doesn't report progress. Modify WorkerReportProgress to stat that it dows report progress.
...
วิธีแก้ปัญหา ดังนี้ครับ
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
BackgroundWorker1.WorkerReportsProgress = True
BackgroundWorker1.WorkerSupportsCancellation = True
End Sub
หรือจะใส่ใน sub new ก็ได้ครับ แบบนี้
Public Sub New()
InitializeComponent()
BackgroundWorker1.WorkerReportsProgress = True
BackgroundWorker1.WorkerSupportsCancellation = True
End Sub
"InavlidOperationExeception was unhandled by user code"
This BackgroundWorker states that it doesn't report progress. Modify WorkerReportProgress to stat that it dows report progress.
...
วิธีแก้ปัญหา ดังนี้ครับ
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
BackgroundWorker1.WorkerReportsProgress = True
BackgroundWorker1.WorkerSupportsCancellation = True
End Sub
หรือจะใส่ใน sub new ก็ได้ครับ แบบนี้
Public Sub New()
InitializeComponent()
BackgroundWorker1.WorkerReportsProgress = True
BackgroundWorker1.WorkerSupportsCancellation = True
End Sub
25 มีนาคม 2557
13 มีนาคม 2557
How to run Xampp Auto Start With Windows วิธีรัน Xampp พร้อมวินโดวส์
1.คลิกขวาที่ Xampp-Control เลือกเมนู Run as administrator
2. คลิกให้มีเครื่องหมายถูกที่ Service หน้า Apache ,MySql และอื่นๆ ที่ต้องการ
จากนั้นคลิกที่ Start
11 มีนาคม 2557
Function แสดงขนาดของไฟล์โดยนำเข้าขนาด Bytes เข้ามาคำนวณ (VB.Net)
Private Function fSize(ByVal oSize As Double)
Dim mySize As String = ""
If oSize < 1024 Then
mySize = Format(oSize, "#,##0.00") & " Bt"
Else
If (oSize / 1024) < 1024 Then
mySize = Format((oSize / 1024), "#,##0.00") & " Kb"
Else
If (oSize / 1024 / 1024) < 1024 Then
mySize = Format((oSize / 1024 / 1024), "#,##0.00") & " Mb"
Else
mySize = Format((oSize / 1024 / 1024 / 1024), "#,##0.00") & " Gb"
End If
End If
End If
Return mySize
End Function
Dim mySize As String = ""
If oSize < 1024 Then
mySize = Format(oSize, "#,##0.00") & " Bt"
Else
If (oSize / 1024) < 1024 Then
mySize = Format((oSize / 1024), "#,##0.00") & " Kb"
Else
If (oSize / 1024 / 1024) < 1024 Then
mySize = Format((oSize / 1024 / 1024), "#,##0.00") & " Mb"
Else
mySize = Format((oSize / 1024 / 1024 / 1024), "#,##0.00") & " Gb"
End If
End If
End If
Return mySize
End Function
สมัครสมาชิก:
บทความ (Atom)
