View Single Post

  #3 (permalink)  
Old 01-25-2007, 10:49 AM
Gurpreet Kaur Gurpreet Kaur is offline
Junior Member
 
Join Date: Jan 2007
Posts: 3
Gurpreet Kaur is on a distinguished road
hello

I m using sql server.my coding is
Imports System.Data.sqlclient

Public Class code
Inherits System.Windows.Forms.Form

Dim CON As New SqlConnection
Dim CMD As New SqlCommand
Dim ADP As New SqlDataAdapter
Dim CB As New SqlCommandBuilder
Dim DS As New DataSet
Dim DR As DataRow
Dim P(1) As DataColumn

Private Sub code_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

CON.ConnectionString = "USER ID=SA; DATA SOURCE=server name;INITIAL CATALOG=FIRST"
CMD.Connection = CON
ADP.SelectCommand = CMD
CMD.CommandText = "SELECT * FROM EMP"
ADP.Fill(DS, "EMP")
P(0) = DS.Tables("EMP").Columns("CODE")
DS.Tables("EMP").PrimaryKey = P
MsgBox("CONNECTED TO DATABASE")

End sub

Quote:
Originally Posted by rameshuddaraju View Post
Hello
how can we get information about your error with out your written code
Paste your code here.
Reply With Quote