Vb.net and SQL

Linking VB.NET and SQL database

Page 1 of 1

4 Replies - 5421 Views - Last Post: 07 December 2016 - 07:40 AM Rate Topic: -----

#1 Bluray  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 09-March 10

Vb.net and SQL

Posted 09 March 2010 - 03:35 AM

How to connect an application in VB.NET to SQL database
Is This A Good Question/Topic? 0
  • +

Replies To: Vb.net and SQL

#2 camckee316  Icon User is offline

  • D.I.C Regular

Reputation: 15
  • View blog
  • Posts: 283
  • Joined: 29-August 08

Re: Vb.net and SQL

Posted 09 March 2010 - 04:46 AM

look through the snippets and tutorials. then if you still have some trouble post some code on what you have done, attempted to do then someone can help you.
Was This Post Helpful? 0
  • +
  • -

#3 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1726
  • View blog
  • Posts: 5,696
  • Joined: 25-September 09

Re: Vb.net and SQL

Posted 09 March 2010 - 05:24 AM

SQL Basics in VB.Net
Was This Post Helpful? 1
  • +
  • -

#4 lalitprg  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 05-December 16

Re: Vb.net and SQL

Posted 07 December 2016 - 07:25 AM

Please Use Below Mentioned Code And Create Once conn.INI file Mention Details like Servername,database, usernmae and Pass word in that file As in attached file


Module modINI


    Private Declare Unicode Function WritePrivateProfileString Lib "kernel32" _
    Alias "WritePrivateProfileStringW" (ByVal lpApplicationName As String, _
    ByVal lpKeyName As String, ByVal lpString As String, _
    ByVal lpFileName As String) As Int32

    Private Declare Unicode Function GetPrivateProfileString Lib "kernel32" _
    Alias "GetPrivateProfileStringW" (ByVal lpApplicationName As String, _
    ByVal lpKeyName As String, ByVal lpDefault As String, _
    ByVal lpReturnedString As String, ByVal nSize As Int32, _
    ByVal lpFileName As String) As Int32

    Public Sub writeIni(ByVal iniFileName As String, ByVal Section As String, ByVal ParamName As String, ByVal ParamVal As String)
        Dim Result As Integer = WritePrivateProfileString(Section, ParamName, ParamVal, iniFileName)
    End Sub

    Public Function ReadIni(ByVal IniFileName As String, ByVal Section As String, ByVal ParamName As String, ByVal ParamDefault As String) As String
        Dim ParamVal As String = Space$(1024)
        Dim LenParamVal As Long = GetPrivateProfileString(Section, ParamName, ParamDefault, ParamVal, Len(ParamVal), IniFileName)
        ReadIni = Left$(ParamVal, LenParamVal)
    End Function
End Module




Was This Post Helpful? 0
  • +
  • -

#5 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 12446
  • View blog
  • Posts: 48,907
  • Joined: 12-June 08

Re: Vb.net and SQL

Posted 07 December 2016 - 07:40 AM

@lalitprg - What was that? IF you are going to necro a topic six years buried with a rando code dump please try and explain your code, why it solves the issue, and with comments.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1