Jump to content
Sign in to follow this  
Zamri Tumidi

Masuk Data Kat Form Automatic Masuk Dlam Database

Recommended Posts

Protected Sub SimpanAduan()

Dim OLEConn As New System.Data.Odbc.OdbcConnection

Dim OLESql As New System.Data.Odbc.OdbcCommand

Dim data As System.Data.Odbc.OdbcDataReader

OLEConn.Open()

Dim i As Integer

row = 0

OLEConn.ConnectionString = "server=jbendmain;uid=jbend;pwd=bendahari;database=jbend

_db"

Try

OLEConn.Open()

OLESql.Connection = OLEConn

OLESql.CommandText = Sql

If optionReturnData Then

data = OLESql.ExecuteReader()

myArray(row, i) = ""

Else

OLESql.ExecuteReader()

End If

OLESql.Cancel()

OLEConn.Close()

Return

Catch ex As Exception

Response.Write("Proses tidak berjaya. Sila hubungi Pengurus Sistem dengan menyalin Ralat berikut : <BR>" + ex.ToString + Sql)

Return

End Try

Sql = "INSERT Into ad_AduanHdr VALUES('" + txtIdAduan.Text + "','" + ddlKategori.SelectedValue + "','" + txtNoKadPengenalan.Text + "','" + txtNama.Text + "','" + _

txtEmail.Text + "','" + txtNoTelefon.Text + "','" + txtNoHp.Text + "','" + txtAdd1.Text + "','" + txtAdd2.Text + "','" + _

txtPoskod.Text + "','" + txtBandar.Text + "','" + ddlNegeri.SelectedValue + "','" + ddlNegara.SelectedValue + "','" + txtTajuk.Text + "','" + _

txtAduanArea.Text + "','" + rbJenis.SelectedValue + "',getdate()')"

End Sub

apa salah ku =s

Share this post


Link to post
Share on other sites

Sql = "INSERT Into ad_AduanHdr VALUES('" + txtIdAduan.Text + "','" + ddlKategori.SelectedValue + "','" + txtNoKadPengenalan.Text + "','" + txtNama.Text + "','" + _

txtEmail.Text + "','" + txtNoTelefon.Text + "','" + txtNoHp.Text + "','" + txtAdd1.Text + "','" + txtAdd2.Text + "','" + _

txtPoskod.Text + "','" + txtBandar.Text + "','" + ddlNegeri.SelectedValue + "','" + ddlNegara.SelectedValue + "','" + txtTajuk.Text + "','" + _

txtAduanArea.Text + "','" + rbJenis.SelectedValue + "',getdate()')"

cuba letak sblm

OLESql.CommandText = Sql

Share this post


Link to post
Share on other sites

nuyiel,minta ym or email ko plz

ini coding yg baru,masalah sekarang nie dekat sini

Public sDB As String = ConfigurationManager.ConnectionStrings("AduanPelajar").ConnectionString
ini dalam web config aku
<connectionStrings>
		<add name="AduanPelajar" connectionString="DSN=jbendmain ; Uid =jbend ; Pwd = bendahari ; trusted_connection = yes" providerName="System.Data.Odbc"/>
	</connectionStrings>

aku guna sybase,x reti nak wat connection string

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...