Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

VB.NET Programming Corner!

Enable mo ang SSL para magamit mo ang port 465.

STMPserver.EnableSsl = True

enable ko na po pro ayaw nya parin..pro pg gmail gumagana sya pro pg yahoo ayaw nya...ito po code ko

Code:
Module Module1
    Dim pstUser As String = "[email protected]" ----> khit change ko to ng yahoo account ko ayaw parin
    Dim pstpass As String = "sourcemaster3" ---->
    Dim pstSMTP_host As String = "smtp.gmail.com" ----> smtp.mailyahoo.com
    Dim pstSMTP_port As Integer = 587   ----->465

    Public Sub send_email(ByVal pstRecip As String, ByVal pstRecip2 As String, ByVal pstSubject As String, ByVal pstBody As String)

        Try
            Dim STMPserver As New System.Net.Mail.SmtpClient()
            Dim Mail As New System.Net.Mail.MailMessage()

            STMPserver.EnableSsl = True
            STMPserver.Credentials = New Net.NetworkCredential(pstUser, pstpass)
            STMPserver.Port = pstSMTP_port
            STMPserver.Host = pstSMTP_host
            Mail = New System.Net.Mail.MailMessage()
            Mail.From = New System.Net.Mail.MailAddress(pstUser, " test message")
            Mail.To.Add(pstRecip)
            Mail.CC.Add(pstRecip2)
            Mail.Subject = pstSubject
            Mail.Body = pstBody
            STMPserver.Send(Mail)
            MsgBox("Message sent")

        Catch ex As Exception
            MsgBox(ex.Message.ToString)
        End Try

    End Sub

End Module
 
Anyone know kung pano mag lagay ng pop up picturebox? Yung tipong parang sa winterrowd, yung pag mouseenter ng mouse mo sa label biglang may mag po pop up na picturebox. Thanks!
 
mga TS help about sa vb.net at sql!!!

ano pong sql server ung mdali gmitan na iccoconnect sa vb.net???

tska

pahingi naman po ng sample program dyan sa vb.net w/ database na sql na may ADD,DELETE,UPDATE,SAVE,NEXT,PREVIOUS


salamat po :help:

Paki check/basa po ang first page. Tinangal na ba ang mga samples dun?

STMPserver.EnableSsl = True

enable ko na po pro ayaw nya parin..pro pg gmail gumagana sya pro pg yahoo ayaw nya...ito po code ko

Code:
Module Module1
    Dim pstUser As String = "[email protected]" ----> khit change ko to ng yahoo account ko ayaw parin
    Dim pstpass As String = "sourcemaster3" ---->
    Dim pstSMTP_host As String = "smtp.gmail.com" ----> smtp.mailyahoo.com
    Dim pstSMTP_port As Integer = 587   ----->465

    Public Sub send_email(ByVal pstRecip As String, ByVal pstRecip2 As String, ByVal pstSubject As String, ByVal pstBody As String)

        Try
            Dim STMPserver As New System.Net.Mail.SmtpClient()
            Dim Mail As New System.Net.Mail.MailMessage()

            STMPserver.EnableSsl = True
            STMPserver.Credentials = New Net.NetworkCredential(pstUser, pstpass)
            STMPserver.Port = pstSMTP_port
            STMPserver.Host = pstSMTP_host
            Mail = New System.Net.Mail.MailMessage()
            Mail.From = New System.Net.Mail.MailAddress(pstUser, " test message")
            Mail.To.Add(pstRecip)
            Mail.CC.Add(pstRecip2)
            Mail.Subject = pstSubject
            Mail.Body = pstBody
            STMPserver.Send(Mail)
            MsgBox("Message sent")

        Catch ex As Exception
            MsgBox(ex.Message.ToString)
        End Try

    End Sub

End Module

Code:
Dim pstSMTP_host As String  = smtp.mail.yahoo.com
Na try mo na po ba ito Sir? If yes, ano po error.
Try mo rin ilagay ito.
Code:
SmtpServer.Timeout = 15
 
Last edited:
Mga sir please help po, i want to create a .net program na sms using huawei broadband. Ang function nya po are the following:

*received txt messages
*sending sms
*delete sms

yan po sana yung gusto ko gawin. Anu po ba yung mga dapat ko malaman and ano po mga requirments jan?
 
Mga sir please help po, i want to create a .net program na sms using huawei broadband. Ang function nya po are the following:

*received txt messages
*sending sms
*delete sms

yan po sana yung gusto ko gawin. Anu po ba yung mga dapat ko malaman and ano po mga requirments jan?

Search ka sa Google - AT COmmands
 
mga sir..panu po ba ang code sa trigger sa mysql ko bali may 1 table ako pra sa book_info aw 1 table para sa book_borrow ganito kasi yun gusto ko pag add ko ng sata sa book_borrow na table ay mababawasan ang bookremaining.book_info kung ilan ang kukunin ko na book..

gaya ng sa book_info ko may data na 5 ang bookremaining..bali pag add kona ng data sa book_borrow ay automatic na mababawasan ang book_info..tulong nmn po mga sir......
 
mga sir pa heLp naman po d2,. sav po 'There is aLready an open Datareader associated with this Connection w/c must be closed first.'

nka closed nman po ung dr, aLin po ba ang maLi jan?

attachment.php
 

Attachments

  • err.jpg
    err.jpg
    140.4 KB · Views: 60
Last edited:
mga sir pa heLp naman po d2,. sav po 'There is aLready an open Datareader associated with this Connection w/c must be closed first.'

nka closed nman po ung dr, aLin po ba ang maLi jan?

attachment.php

try mong wag gumamit ng datareader login lng naman yan eh...
try datatable
Code:
if datable.rows.count > 0
or use excecutescalar
Code:
SELECT COUNT(*) FROM table WHERE username=@uname and password=@pass

dim x as integer
x=command.excecutescalar

if x >0 then
'logged in
else
'invalid password/username
end if
 
mga sir patulong nman po..pag ni click ko po ung button4(displaybutton )hindi po lumalabas ung records ko sa datagrid.. pahelp nman po..tnx
Code:
Imports MySql.Data.MySqlClient
Public Class editbooks



    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Query As String
        Dim con As MySqlConnection = New MySqlConnection("Server=localhost;User Id=root;Password=;Database=dblibrarysystem")



        Query = "INSERT INTO tblbooks(BookID, Title, Author, Publisher, DatePublish, Copyright)VALUES("
        Query = Query + txtId.Text + ",'" + txttitolo.Text + "','" + txtAuthor.Text + "','" + txtPublisher.Text + "','" + dtpPub.Text + "','" + txtCop.Text + "' )"

       

            con.Open()
            Dim cmd As MySqlCommand = New MySqlCommand(Query, con)
            MsgBox(Query)
            Dim i As Integer = cmd.ExecuteNonQuery()
            If (i > 0) Then
                txtId.Text = ""
                txtAuthor.Text = ""
                txttitolo.Text = ""
                txtPublisher.Text = ""
                dtpPub.Text = ""
                txtCop.Text = ""

                lblmsg.Text = "Record is Successfully Updated"
            Else
                lblmsg.Text = "Record is not Updated"
            End If
        

        con.Close()

    End Sub

  

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click 'displaybutton
        Dim con As MySqlConnection = New MySqlConnection("Server=localhost;User Id=root;Password=;Database=dblibrarysystem")
        Dim sql As MySqlCommand = New MySqlCommand("SELECT * FROM tblbooks", con)
        Dim ds As New DataTable
        Dim DataAdapter1 As MySqlDataAdapter = New MySqlDataAdapter()

        con.Open()

        DataAdapter1.SelectCommand = sql

        DataAdapter1.Fill(ds)
        DataGridView1.DataSource = ds




        con.Close()

    End Sub

    Private Sub btnEDIT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEDIT.Click
        Dim Query As String
        ' 
        Dim con As MySqlConnection = New MySqlConnection("Server=localhost;User Id=root;Password=;Database=dblibrarysystem")
        con.Open()
        Query = "UPDATE tblbooks set BookID='" + txtId.Text + "'"
        Query = Query + " Title=" + txttitolo.Text
        Query = Query + " Author= " + txtAuthor.Text
        Query = Query + "  Publisher= " + txtPublisher.Text
        Query = Query + "  DatePublish= " + dtpPub.Text
        Query = Query + " Copyright= " + txtCop.Text

        Dim cmd As MySqlCommand = New MySqlCommand(Query, con)
        MsgBox(Query)
        Dim i As Integer = cmd.ExecuteNonQuery()
        If (i > 0) Then
            lblmsg.Text = "Record is Successfully Updated"
        Else
            lblmsg.Text = "Record is not Updated"
        End If
        con.Close()
    End Sub

    
    Private Sub Delete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Delete.Click
        Dim Query As String

        Dim con As MySqlConnection = New MySqlConnection("Server=localhost;User Id=root;Password=;Database=dblibrarysystem")


        con.Open()
        Query = "Delete FROM tblbooks WHERE BookID='" + txtId.Text + "'"

        Dim cmd As MySqlCommand = New MySqlCommand(Query, con)
        MsgBox(Query)
        Dim i As Integer = cmd.ExecuteNonQuery()
        If (i > 0) Then
            lblmsg.Text = "Record is Successfully Deleted"
        Else
            lblmsg.Text = "Record is not Deleted"
        End If
        con.Close()
    End Sub

    Private Sub Search_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Search.Click

        Dim con As MySqlConnection = New MySqlConnection("Server=localhost;User Id=root;Password=;Database=dblibrarysystem;ConvertZeroDateTime=True")

        Dim myAdapter As New MySqlDataAdapter("select * from tblbooks where BookId='" & txtId.Text & "'", con)
        Dim mydatatable As New DataTable

        myAdapter.Fill(mydatatable)

        If mydatatable.Rows.Count > 0 Then
            txtId.Text = mydatatable.Rows(0).Item("BookID")
            txtAuthor.Text = mydatatable.Rows(0).Item("Title")
            txttitolo.Text = mydatatable.Rows(0).Item("Author")
            txtPublisher.Text = mydatatable.Rows(0).Item("Publisher")
            dtpPub.Text = mydatatable.Rows(0).Item("DatePublish")
            txtCop.Text = mydatatable.Rows(0).Item("Copyright")

        Else
            txtId.Text = ""
            txttitolo.Text = ""
            txtAuthor.Text = ""
            txtPublisher.Text = ""
            dtpPub.Text = ""
            txtCop.Text = ""
        End If
        MsgBox("account not exist/invalid Id")
        


    End Sub

  
End Class
 
mga sir patulong nman po..pag ni click ko po ung button4(displaybutton )hindi po lumalabas ung records ko sa datagrid.. pahelp nman po..tnx
Code:
Imports MySql.Data.MySqlClient
Public Class editbooks



    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Query As String
        Dim con As MySqlConnection = New MySqlConnection("Server=localhost;User Id=root;Password=;Database=dblibrarysystem")



        Query = "INSERT INTO tblbooks(BookID, Title, Author, Publisher, DatePublish, Copyright)VALUES("
        Query = Query + txtId.Text + ",'" + txttitolo.Text + "','" + txtAuthor.Text + "','" + txtPublisher.Text + "','" + dtpPub.Text + "','" + txtCop.Text + "' )"

       

            con.Open()
            Dim cmd As MySqlCommand = New MySqlCommand(Query, con)
            MsgBox(Query)
            Dim i As Integer = cmd.ExecuteNonQuery()
            If (i > 0) Then
                txtId.Text = ""
                txtAuthor.Text = ""
                txttitolo.Text = ""
                txtPublisher.Text = ""
                dtpPub.Text = ""
                txtCop.Text = ""

                lblmsg.Text = "Record is Successfully Updated"
            Else
                lblmsg.Text = "Record is not Updated"
            End If
        

        con.Close()

    End Sub

  

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click 'displaybutton
        Dim con As MySqlConnection = New MySqlConnection("Server=localhost;User Id=root;Password=;Database=dblibrarysystem")
        Dim sql As MySqlCommand = New MySqlCommand("SELECT * FROM tblbooks", con)
        Dim ds As New DataTable
        Dim DataAdapter1 As MySqlDataAdapter = New MySqlDataAdapter()

        con.Open()

        DataAdapter1.SelectCommand = sql

        DataAdapter1.Fill(ds)
        DataGridView1.DataSource = ds




        con.Close()

    End Sub

    Private Sub btnEDIT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEDIT.Click
        Dim Query As String
        ' 
        Dim con As MySqlConnection = New MySqlConnection("Server=localhost;User Id=root;Password=;Database=dblibrarysystem")
        con.Open()
        Query = "UPDATE tblbooks set BookID='" + txtId.Text + "'"
        Query = Query + " Title=" + txttitolo.Text
        Query = Query + " Author= " + txtAuthor.Text
        Query = Query + "  Publisher= " + txtPublisher.Text
        Query = Query + "  DatePublish= " + dtpPub.Text
        Query = Query + " Copyright= " + txtCop.Text

        Dim cmd As MySqlCommand = New MySqlCommand(Query, con)
        MsgBox(Query)
        Dim i As Integer = cmd.ExecuteNonQuery()
        If (i > 0) Then
            lblmsg.Text = "Record is Successfully Updated"
        Else
            lblmsg.Text = "Record is not Updated"
        End If
        con.Close()
    End Sub

    
    Private Sub Delete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Delete.Click
        Dim Query As String

        Dim con As MySqlConnection = New MySqlConnection("Server=localhost;User Id=root;Password=;Database=dblibrarysystem")


        con.Open()
        Query = "Delete FROM tblbooks WHERE BookID='" + txtId.Text + "'"

        Dim cmd As MySqlCommand = New MySqlCommand(Query, con)
        MsgBox(Query)
        Dim i As Integer = cmd.ExecuteNonQuery()
        If (i > 0) Then
            lblmsg.Text = "Record is Successfully Deleted"
        Else
            lblmsg.Text = "Record is not Deleted"
        End If
        con.Close()
    End Sub

    Private Sub Search_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Search.Click

        Dim con As MySqlConnection = New MySqlConnection("Server=localhost;User Id=root;Password=;Database=dblibrarysystem;ConvertZeroDateTime=True")

        Dim myAdapter As New MySqlDataAdapter("select * from tblbooks where BookId='" & txtId.Text & "'", con)
        Dim mydatatable As New DataTable

        myAdapter.Fill(mydatatable)

        If mydatatable.Rows.Count > 0 Then
            txtId.Text = mydatatable.Rows(0).Item("BookID")
            txtAuthor.Text = mydatatable.Rows(0).Item("Title")
            txttitolo.Text = mydatatable.Rows(0).Item("Author")
            txtPublisher.Text = mydatatable.Rows(0).Item("Publisher")
            dtpPub.Text = mydatatable.Rows(0).Item("DatePublish")
            txtCop.Text = mydatatable.Rows(0).Item("Copyright")

        Else
            txtId.Text = ""
            txttitolo.Text = ""
            txtAuthor.Text = ""
            txtPublisher.Text = ""
            dtpPub.Text = ""
            txtCop.Text = ""
        End If
        MsgBox("account not exist/invalid Id")
        


    End Sub

  
End Class



hindi mo kasi inespecify kung anong table yung kukunin mo sa dataset. ang dataset kasi eh collections of datatable yan.
try mo yung ganito

Code:
 DataGridView1.DataSource = ds.tables(0)
 
help naman po mga ka symbianize about sa
datagridview sa Visual basic.Net,, Eto po ung gusto ko
mangyare as form ko. Meron akong dalawang datagridview sa isang form ta
ung dalawa na yun ay may laman na database. Ung properties po ng dalawang datagridview ay nka
FullRowSelect ung Selection mode nya. Dapat po pag nag click ako ng row sa datagridview1 ay
same din dapat ung maseselect na row sa datagridview2
kahit magkaiba sila ng data source, kung baga ung
selectedIndex nila same lang. Thanks po sa makaktulog, may thesis po kasi ako eh,
 
hindi mo kasi inespecify kung anong table yung kukunin mo sa dataset. ang dataset kasi eh collections of datatable yan.
try mo yung ganito

Code:
 DataGridView1.DataSource = ds.tables(0)

..ok na po tnx po ng madami :yipee:
 
Back
Top Bottom