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
Hello
how can we get information about your error with out your written code
Paste your code here.
|