What to choose ?

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

39 Replies - 950 Views - Last Post: 08 September 2012 - 05:08 AM Rate Topic: -----

#1 chdboy  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 90
  • Joined: 26-July 12

What to choose ?

Posted 26 July 2012 - 01:51 AM

Hi

I have a project which I will have to make it in VB I'm using Visual Studio 2012 Trial Version only I have to make an application which will run on Desktop PC of a small company I'm confused which database to use?I mean SQL looks fine but I don't have an SQL server and the problem is If I can arrange for one do I have to install the whole server to those PC which the application will be running ?
Is This A Good Question/Topic? 0
  • +

Replies To: What to choose ?

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3039
  • View blog
  • Posts: 4,548
  • Joined: 08-June 10

Re: What to choose ?

Posted 26 July 2012 - 02:32 AM

Moved to the VB.NET forum. VS 2012 doesn't support VB6.

If you are creating desktop applications that don't require a centralized database server, then you don't want to use a typical SQL Server. You can, however, use things like SQL Server Compact or SQLite. They allow you to use standard SQL queries (with some limitations) but use database files rather than database servers. You can just have them use files on the local file-system to store the data.

Unless I'm mistaken, Visual Studio 2012 should include all that you need to start working with SQL Server Compact databases, so that's probably the best option for you. See the link I posted above for some info on how to use it.
Was This Post Helpful? 0
  • +
  • -

#3 chdboy  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 90
  • Joined: 26-July 12

Re: What to choose ?

Posted 26 July 2012 - 03:07 AM

Thanks for the reply I think then I will also go with sqlite as suggested by you is vb6 diffrent from .net?and how do I use .net...like I'm using Visual studio right now is there any application for .net?
Was This Post Helpful? 0
  • +
  • -

#4 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3039
  • View blog
  • Posts: 4,548
  • Joined: 08-June 10

Re: What to choose ?

Posted 26 July 2012 - 03:31 AM

Quote

is vb6 diffrent from .net?

Yes. VB6 is an old version of Visual Basic that is no longer supported. VB.NET is it's successor. It's what Microsoft is currently supporting, and what all recent versions of Visual Studio have been using.

Quote

and how do I use .net...like I'm using Visual studio right now is there any application for .net?

The .NET Framework is the core of both the VB.NET and C# languages (as well as several others). When you use "Visual Basic" inside Visual Studio, then you are using VB.NET, which is using the .NET Framework.
Was This Post Helpful? 0
  • +
  • -

#5 chdboy  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 90
  • Joined: 26-July 12

Re: What to choose ?

Posted 26 July 2012 - 07:14 AM

ok so what I was doing,I was doing with VB.NET...that sounds good ...there are so many files on that SQlite link which one to choose and go for it?
Was This Post Helpful? 0
  • +
  • -

#6 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 200
  • View blog
  • Posts: 1,523
  • Joined: 12-January 10

Re: What to choose ?

Posted 26 July 2012 - 07:19 AM

dl sql server 2008 free edition for your os it will save you a lot of headaches later on if you continue to use sql
Was This Post Helpful? 0
  • +
  • -

#7 chdboy  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 90
  • Joined: 26-July 12

Re: What to choose ?

Posted 26 July 2012 - 07:47 AM

how to open sql connection in .NET?
Was This Post Helpful? 0
  • +
  • -

#8 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 200
  • View blog
  • Posts: 1,523
  • Joined: 12-January 10

Re: What to choose ?

Posted 26 July 2012 - 08:05 AM

did you try

dim con as new sqlconnection

Was This Post Helpful? 0
  • +
  • -

#9 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3039
  • View blog
  • Posts: 4,548
  • Joined: 08-June 10

Re: What to choose ?

Posted 26 July 2012 - 08:08 AM

View PostDarenR, on 26 July 2012 - 02:19 PM, said:

dl sql server 2008 free edition for your os it will save you a lot of headaches later on if you continue to use sql

As I understand him, he's talking about creating a desktop application without a centralized server. Using SQL Server 2008 for that is nothing but trouble, not to mention a major overkill. He's much better of using SQL Server Compact or SQLite.

View Postchdboy, on 26 July 2012 - 02:47 PM, said:

how to open sql connection in .NET?

There are plenty of tutorials available that discuss that in detail. It shouldn't take more than a few minutes on Google to locate a few million of those.

In fact, we have on right here on DIC, in the VB.NET Tutorials section.
- SQL Basics In VB.Net
Was This Post Helpful? 0
  • +
  • -

#10 chdboy  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 90
  • Joined: 26-July 12

Re: What to choose ?

Posted 26 July 2012 - 08:16 AM

View PostDarenR, on 26 July 2012 - 08:05 AM, said:

did you try

dim con as new sqlconnection

I have tried this in my form

Imports System.Data.SqlClient
Public Class AddNewCompany
    Inherits System.Windows.Forms.Form
    'Create ADO.NET objects.
    Private myConn As SqlConnection
    Private myCmd As SqlCommand
    Private myReader As SqlDataReader
    Private results As String

This post has been edited by Atli: 26 July 2012 - 08:18 AM
Reason for edit:: Please use [code] tags when posting code.

Was This Post Helpful? 0
  • +
  • -

#11 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 200
  • View blog
  • Posts: 1,523
  • Joined: 12-January 10

Re: What to choose ?

Posted 26 July 2012 - 08:23 AM

add the "new" key word

View PostAtli, on 26 July 2012 - 11:08 AM, said:

View PostDarenR, on 26 July 2012 - 02:19 PM, said:

dl sql server 2008 free edition for your os it will save you a lot of headaches later on if you continue to use sql

As I understand him, he's talking about creating a desktop application without a centralized server. Using SQL Server 2008 for that is nothing but trouble, not to mention a major overkill. He's much better of using SQL Server Compact or SQLite.



you are correct if that is what he is trying to accomplish
Was This Post Helpful? 0
  • +
  • -

#12 chdboy  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 90
  • Joined: 26-July 12

Re: What to choose ?

Posted 08 August 2012 - 07:22 AM

what's wrong with this code in
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Call Login(usernameTextbox.Text, passwordTextbox.Text)


    End Sub




and
 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Call Register(UsernameTextbox.Text, PasswordTextbox.Text)


    End Sub




her is the full code



Public Class Form1
    Private users As New usersDataSetTableAdapters.credentialsTableAdapter
    Private DataSet As New usersDataSet
    

    Private Sub Register(ByVal username As String, ByVal password As String)

        Dim Row As usersDataSet.credentialsRow = DataSet.credentials.FindByusername(username)

        If Row Is Nothing Then

            DataSet.credentials.AddcredentialsRow(username, password)
            users.Update(DataSet)
            MessageBox.Show("!account created")
        Else
            MessageBox.Show("username already exists")


        End If


    End Sub
    Private Sub Login(ByVal username As String, ByVal password As String)
        Dim Row As usersDataSet.credentialsRow = DataSet.credentials.FindByusername(username)

        If Not Row Is Nothing AndAlso Row.password = password Then
            MessageBox.Show("Found match ...loging in ")
        Else
            MessageBox.Show("Match not found ")

        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Call Login(usernameTextbox.Text, passwordTextbox.Text)


    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Call Register(UsernameTextbox.Text, PasswordTextbox.Text)


    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        users.Fill(DataSet.credentials())

    End Sub
End Class


Was This Post Helpful? 0
  • +
  • -

#13 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 6430
  • View blog
  • Posts: 23,409
  • Joined: 12-June 08

Re: What to choose ?

Posted 08 August 2012 - 07:28 AM

Outside of you using the 'call'? How about you tell us. Is it giving an error? If so what is that error text. Is it not behaving as expected? Then describe what it is doing currently and what it should be doing.

Debugging by proxy is rarely a fun activity for anyone involved.
Was This Post Helpful? 0
  • +
  • -

#14 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 200
  • View blog
  • Posts: 1,523
  • Joined: 12-January 10

Re: What to choose ?

Posted 08 August 2012 - 07:30 AM

Why are you saying call? what version of vb.net are you using?


try something like

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click  

       Login(usernameTextbox.Text, passwordTextbox.Text)  

  

  
    End Sub 

Was This Post Helpful? 0
  • +
  • -

#15 chdboy  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 90
  • Joined: 26-July 12

Re: What to choose ?

Posted 08 August 2012 - 07:35 AM

Errors

usernameTextbox is not declared
passwordTextbox is not declared


It is a simple log in form with two text fields username and password
and two buttons Login and Register

If I choose a username and password and hit register it should say account created or else username already exist



but it gives me errors as I have stated above
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3