An unhandled exception of type "system

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dyên ổn fs As New FileInfo("V:exevedas.ini") Dlặng strsqlserverpath As String = fs.FullName Dim str As String str = "data source="" và strsqlserverpath và "";initial catalog="CDSIL";persist security info=False;user id="" và "cdas" & "";Password="" & "CMCITES" & "";packet size=4096" Dyên con As New SqlClient.SqlConnection(str) Dim updatesql As String = "UPDATE REPORTMASTER SET DELIMITER = " + "~" " Dim da As New SqlClient.SqlDataAdapter() con.Open() Dyên updatecommvà As New SqlClient.SqlCommand(updatesql, con) updatecommand.ExecuteNonQuery() nhỏ.Close() End Sub
I get this error message at nhỏ.open()
*
"An unhandled exception of type "System.Data.SqlClient.SqlException" occurred in system.data.dll Additional information: System error. ..."
THE BEST WAY TO THANK A HELPFUL POST IS TO RATE IT!!!! Take up one idea. Make that one idea your life - think of it, dream of it, live sầu on that idea. Let the brain, muscles, nerves, every part of your body, be full of that idea, and just leave sầu every other idea alone.

Bạn đang xem: An unhandled exception of type "system


Reply With Quote

.NUT
*
Join Date May 2005Location Sydney, AustraliaPosts 106,632
If you can"t open the connection then your connection string is invalid. have you tested the value of "str" khổng lồ make sure it contains what you think it does? Have you compared that value to lớn the valid formats provided at www.connectionstrings.com?Instead of using string concatenation khổng lồ build connection strings, which is obviously error-prone, you should be using an SqlConnectionStringBuilder. That"s what they"re for.

Xem thêm: Hướng Dẫn Làm Website Bán Hàng, Cách Lập Trang Web Bán Hàng Nhanh Và Dễ Nhất


Why is my data not saved to lớn my database? | MSDN Data Walkthroughssavoirjoaillerie.com Database Development FAQMy CodeBank Submissions: VB (Sorting AlphaNumeric Strings Logically NEW
, Binding a Data Reader in Windows Forms NEW) | C# (Sorting AlphaNumeric Strings Logically NEW, Binding a Data Reader in Windows Forms NEW)My Blog: Data Among Multiple Forms (3 parts)Beginner Tutorials: VB | C# | SQL
Reply With Quote

Hi John..I got it..Thank you.The connection string was incorrect.I will check that links out.Take care,Sid.

Xem thêm: Tìm Hiểu Về Tiêu Chuẩn Jis Là Gì ? Tiêu Chuẩn Công Nghiệp Nhật Bản


THE BEST WAY TO THANK A HELPFUL POST IS TO RATE IT!!!!
Take up one idea. Make that one idea your life - think of it, dream of it, live sầu on that idea. Let the brain, muscles, nerves, every part of your body, be full of that idea, & just leave sầu every other idea alone.
Quiông chồng NavigationVisual Basic .NETTopSite AreasForumsVisual BasicVisual Basic .NETVisual Basic 6 & EarlierGames and Graphics Programming.NET and MoreGeneralsavoirjoaillerie.com Coding ContestsOther Languagessavoirjoaillerie.com CodeBanksavoirjoaillerie.com UtilityBankProjectsJobsCommunityGeneral Discussion / Chit Chat

Chuyên mục: Blogs