Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

IS that VB.net programming language is helpfull

Status
Not open for further replies.

Ganesh_kolhe

Junior Member level 1
Joined
Jan 13, 2010
Messages
18
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,281
Location
pune
Activity points
1,366
To interface Embedded Systems to PC
VB.net Language is perfect or not

IF yes can anybody give me the information about database connectivity in Vb .net

Regards,
Ganesh
Embspark Technologies
 

Hi,

VB.Net is really perfect! great...

database connectivity in Vb .net? so SQL or Access?

for Sql, first import 2 name spaces: 'System.Data' and 'System.Data.SqlClient'
for Access, import 2 name spaces: 'System.Data' and 'System.Data.Oledb'

Now, Look at this sample:

Step 1:
I wanna make a database connectivity using Access. first of all Let's import 2 name spaces:

Code:
Imports System.Data
Imports System.Data.OleDb

Step 2:
'ConnectionString': aceess connection string
'CNN': Database connection using 'ConnectionString' value
'DA': Access Data Adapter
'DS': Data set

Code:
 Dim ConnectionString As String = "provider=Microsoft.jet.oledb.4.0;Data Source=" & Application.StartupPath & "\DBInfo.mdb"
    Dim CNN As OleDbConnection = New OleDbConnection(ConnectionString)
    Dim DA As OleDbDataAdapter
    Dim DS As DataSet

Step 3:
Now I wanna add a new record to database...

Code:
 DA = New OleDbDataAdapter("Select * from myTable", CNN)
        DS = New DataSet

        DA.Fill(DS, "myTable")

        Dim DR As DataRow = DS.Tables("myTable").NewRow

        DR("myField1") = "New Value1"
        DR("myField2") = "New Value2"
        .
        .
        .
        .

        DS.Tables("myTable").Rows.Add(DR)

        Dim CMD As OleDbCommandBuilder = New OleDbCommandBuilder(DA)
        DA.Update(DS, "myTable")

        CMD.Dispose()
        DS.Dispose()
        DA.Dispose()
        CNN.Dispose()


Step 4:
I wanna read a record:
Code:
        DA = New OleDbDataAdapter("Select * from myTable where myField1='Value'", CNN)
        DS = New DataSet

        DA.Fill(DS, "myTable")
        
        If DS.Tables("myTable ").Rows.Count = 0 Then
            MsgBox ("not found")
        Else
            MsgBox (DS.Tables("myTable ").Rows(0)("myField1").ToString())
        End If
 

Hi,
I haven't worked with database connectivity, but whatever I've worked in (I only need mathematical calculations for my softwares), I've found VB.NET very very helpful. I use VB.NET 2008.
 

Thanks for the VB code behnam9856
I am having one more question how to attach image file
in database of VB.net

reply
Regards,
Ganesh_kolhe
 

u're welcome...

Try not to attach image files into database! because the database capacity increases

You can save image files in a folder and then put files path into database... this is better...

good luck :)
 

Hi,

follow the link to find out VB.NET code for your request

Binary streaming of large images from Database
https://www.codeproject.com/KB/web-image/ImageBinaryStream.aspx

in additionally user search facility there to get more VB.NET coding




To find the capacity descriptions of MS SQL Server, follow the links below
Maximum Capacity Specifications for SQL Server 2008
https://msdn.microsoft.com/en-us/library/ms143432.aspx

Maximum Capacity Specifications for SQL Server 2005
https://msdn.microsoft.com/en-us/library/ms143432(SQL.90).aspx


Regards
bassa
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top