hemantwithu's Profile User Rating: -----

Reputation: 5 Worker
Group:
Contributors
Active Posts:
33 (0.03 per day)
Joined:
18-October 11
Profile Views:
1,164
Last Active:
User is offline Jun 03 2014 10:30 PM
Currently:
Offline

Previous Fields

Country:
IN
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
XBox
Your Car:
BMW
Dream Kudos:
75
Icon   hemantwithu Online

Posts I've Made

  1. In Topic: Code Challenge: "Hello, World"

    Posted 29 May 2014

    It's a nice challenge to compete . Here is my code
    Spoiler
  2. In Topic: Connecting SQL Server 2005 failed

    Posted 24 Sep 2012

    View PostSwapnilbarde007, on 24 September 2012 - 05:07 PM, said:

    I have newly installed SQL Sever Express edition and SQL server management studio on my system. I have created a demo application in vb.net to test the SQL server connection. I have a form and a DataGridView dragged on it. I inserted following code on load event of form.

    Imports System.Data
    Imports System.Data.SqlClient
    
            Public  Class Form1
    
                    Private Sub Form1_load(sender As Object, e As EventArgs)
                            Dim connetionString As String
                            Dim connection As SqlConnection
                            Dim command As SqlCommand
                            Dim adapter As New SqlDataAdapter()
                            Dim ds As New DataSet()
                            Dim sql As String
    
                            connetionString = "Data Source=SWAPNIL;Initial Catalog=MyTestDb;User ID=sa;Password="
                            sql = "SELECT * FROM tblTEST"
    
                            connection = New SqlConnection(connetionString)
    
                            Try
                                    connection.Open()
                                    command = New SqlCommand(sql, connection)
                                    adapter.SelectCommand = command
                                    adapter.Fill(ds)
                  
                                    connection.Close()
    
                                    DataGridView1.DataSource=Ds.Tables(0)
                            Catch ex As Exception
                                    MessageBox.Show("Can not open connection ! ")
                            End Try
                    End Sub
            End Class
    End Namespace
    
    
    



    I think you are missing some parameters in the Connection String.Please look at you are missing Password.If you want to get the Correct Connection String try to connect to your database in VS 2010 or 2008 using Server Explorer.After It is Connected Successfully right click on the DB in Server Explorer where you will find the Properties Click on it.You will get the Correct Connection String.

    Try this and let me know :-)

My Information

Member Title:
New D.I.C Head
Age:
26 years old
Birthday:
June 4, 1988
Gender:
Location:
Hyderabad
Interests:
Singing Songs
Years Programming:
3
Programming Languages:
C,C++,C#.NET,ASP.NET,SQL SERVER 2005,HTML,CSS,.NET 4.0

Contact Information

E-mail:
Click here to e-mail me
Website URL:
Website URL  http://essencesofdotnet.blogspot.in/

Comments

hemantwithu has no profile comments yet. Why not say hello?