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!

Unregistered = 3 Limits of Download
Registered = Unlimited ata

By the way guys, pa help naman nito

I have 1 combox and 1 textbox

If the combobox select "Notebook" then on the textbox it must be display the corresponding itemStock (3)

Please :(

http://i.imgur.com/JRZ2ojP.png

This is my simple code for calling items on my combox

Code:
Try
            Query = "SELECT * FROM tbl_items"

            MySqlCommand = New MySqlCommand(Query, CNN)
            MySqlDataReader = MySqlCommand.ExecuteReader

            combItems.Items.Clear()

            Do While MySqlDataReader.Read
                       combItems.Items.Add(MySqlDataReader(1))
            Loop

        
            End If

        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Finally
            MySqlDataReader.Close()
        End Try

try it this para hindi mo na need magloop..
need mo lng DISPLAYMEMBER and VALUEMEMBER Property ng Combobox
Code:
DataAdapter.fill(Dataset,0)
Combobox.DataSource=Dataset.Tables(0)
Combobox.ValueMember="PK OF TABLE"
Combobox.DisplayMember="Field to be Displayed"
to get PK of selected value
Code:
varID=Combobox.SelectedValue.tostring()

then requery to get the stock number
Code:
Select StockNumber From table Where id=@id

rough code lng yan...
 
today i saw the difference between a developer and an analyst. what is it? the age! hehe. joke. its the years of experience!
 
Comboboxes!!!

Pa help nga po sa mga magaling mag SQL ka'SB .. paano to ?

here's my code. modify nyo nlng po kung ano ung mali..


Code:
select c.site_id,d.site_id AS APPROVAL_SITE_ID, c.date_survey,d.date_survey AS APPROVAL_DATE_SURVEY, d.approval_status,date_approved,d.remarks
From survinfo_2dir c

JOIN approval d ON c.site_id = d.site_id

WHERE  left(c.site_id, 4) = "SV01" AND datepart(mm, c.date_survey) = 5 AND datepart(yy, c.date_survey) = 2006

GROUP BY c.site_id, d.date_survey,d.site_id, c.date_survey







HERe's the LINK of EXPECTED OUTPUT::

http://www.symbianize.com/attachment.php?attachmentid=774525&d=1376356434

thanks guys..:clap:




-up ko lang yan..


Sir baka may nakakaalam nito ? COMBO BOXES. .see attached picture.. thanks kaSB


View attachment 131151
 

Attachments

  • comboboxes.png
    comboboxes.png
    12.9 KB · Views: 12
Re: Comboboxes!!!

-up ko lang yan..


Sir baka may nakakaalam nito ? COMBO BOXES. .see attached picture.. thanks kaSB


View attachment 774846

select t1.username, t1.site_id, t1.date_survey from table1 t1 inner join table2 t2 on t1.site_id = t2.site_id and t1.date_survey = t2.date_survey where t1.date_survey = '2006-05-12';

dagdagan mo nalang ng group by if 1 row lang per user kukunin mo.
 
Re: Comboboxes!!!

-up ko lang yan..


Sir baka may nakakaalam nito ? COMBO BOXES. .see attached picture.. thanks kaSB


View attachment 774846

saan galing ang mga dates? sa database?

select distinct year(date_survey) from table1;

or

select year(date_survey) from table1 group by year(date_survey);

di ko alam ano objective mo sa paglagay ng date dun sa combobox 2, but pwede mo din e loop from combobox 1. if galing sa database, yung query gamitin.
 
attachment.php


Imports System.Data.OleDb
Public Class Form1

Private Sub PRICELIST___PROFIT_COMPUTATIONBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PRICELIST___PROFIT_COMPUTATIONBindingNavigatorSaveItem.Click
Me.Validate()
Me.PRICELIST___PROFIT_COMPUTATIONBindingSource.EndEdit()
Me.PRICELIST___PROFIT_COMPUTATIONTableAdapter.Update(Me._Mich_MarsDataSet)

Me.PRICELIST___PROFIT_COMPUTATIONBindingSource.EndEdit()
Me.PRICELIST___PROFIT_COMPUTATIONBindingSource.Add(Me._Mich_MarsDataSet)

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the '_Mich_MarsDataSet.SUPPLIER' table. You can move, or remove it, as needed.
Me.SUPPLIERTableAdapter.Fill(Me._Mich_MarsDataSet.SUPPLIER)
'TODO: This line of code loads data into the '_Mich_MarsDataSet.FEEDSS' table. You can move, or remove it, as needed.
Me.FEEDSSTableAdapter.Fill(Me._Mich_MarsDataSet.FEEDSS)
'TODO: This line of code loads data into the '_Mich_MarsDataSet._PRICELIST___PROFIT_COMPUTATION' table. You can move, or remove it, as needed.
Me.PRICELIST___PROFIT_COMPUTATIONTableAdapter.Fill(Me._Mich_MarsDataSet._PRICELIST___PROFIT_COMPUTATION)

End Sub



End Class

--------------------------------------------------------------------------


Patulong naman po dito . SALAMAT PO mga MASTER.:help:
 

Attachments

  • problema.png
    problema.png
    169.6 KB · Views: 42
Re: Comboboxes!!!

saan galing ang mga dates? sa database?

select distinct year(date_survey) from table1;

or

select year(date_survey) from table1 group by year(date_survey);

di ko alam ano objective mo sa paglagay ng date dun sa combobox 2, but pwede mo din e loop from combobox 1. if galing sa database, yung query gamitin.


->idol gumana :) HAHA.. year(distinct) lang pala yung need ko.. eh Sir.Maskio yung in'UP ko ? kaya nyo po bang gawan ng query yun ? hmm. I tried a lot of scripts pero epic eh. here's the link..

http://www.symbianize.com/attachment.php?attachmentid=774525&d=1376356434

TIA :)
 
Last edited:
http://www.symbianize.com/attachment.php?attachmentid=775148&stc=1&d=1376524685

Imports System.Data.OleDb
Public Class Form1

Private Sub PRICELIST___PROFIT_COMPUTATIONBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PRICELIST___PROFIT_COMPUTATIONBindingNavigatorSaveItem.Click
Me.Validate()
Me.PRICELIST___PROFIT_COMPUTATIONBindingSource.EndEdit()
Me.PRICELIST___PROFIT_COMPUTATIONTableAdapter.Update(Me._Mich_MarsDataSet)

Me.PRICELIST___PROFIT_COMPUTATIONBindingSource.EndEdit()
Me.PRICELIST___PROFIT_COMPUTATIONBindingSource.Add(Me._Mich_MarsDataSet)

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the '_Mich_MarsDataSet.SUPPLIER' table. You can move, or remove it, as needed.
Me.SUPPLIERTableAdapter.Fill(Me._Mich_MarsDataSet.SUPPLIER)
'TODO: This line of code loads data into the '_Mich_MarsDataSet.FEEDSS' table. You can move, or remove it, as needed.
Me.FEEDSSTableAdapter.Fill(Me._Mich_MarsDataSet.FEEDSS)
'TODO: This line of code loads data into the '_Mich_MarsDataSet._PRICELIST___PROFIT_COMPUTATION' table. You can move, or remove it, as needed.
Me.PRICELIST___PROFIT_COMPUTATIONTableAdapter.Fill(Me._Mich_MarsDataSet._PRICELIST___PROFIT_COMPUTATION)

End Sub



End Class

--------------------------------------------------------------------------


Patulong naman po dito . SALAMAT PO mga MASTER.:help:

you are updating without an update statement. refer here.
 
Re: Comboboxes!!!

please refer dun sa first reply ko. or click here

->okay na po .. na solve ko na mag isa .. BTW ginawa ko na rin po yang query nyo pero di po ganyan yung expected output eh..

ganito po ginawa ko..


and a.site_id*=b.site_id

--tanong ko lang ano po ba ibig sabihin ng *= ?

thanks.. d naman siya comparison operator eh..

thnks
 
Re: Comboboxes!!!

->okay na po .. na solve ko na mag isa .. BTW ginawa ko na rin po yang query nyo pero di po ganyan yung expected output eh..

ganito po ginawa ko..


and a.site_id*=b.site_id

--tanong ko lang ano po ba ibig sabihin ng *= ?

thanks.. d naman siya comparison operator eh..

thnks

example di mo alam ung field name
SELECT *FROM Table_name (* is selecting all fields in your table)
 
Re: Comboboxes!!!

example di mo alam ung field name
SELECT *FROM Table_name (* is selecting all fields in your table)

dont ever use *, you identify what you need and never ever use *.
 
Re: Comboboxes!!!

example di mo alam ung field name
SELECT *FROM Table_name (* is selecting all fields in your table)

dont ever use *, you identify what you need and never ever use *.

-> what I mean is , hindi siya nakalagay sa SELECTION dun siya sa "WHERE CLAUSE".

Example.

WHERE t1.site_id *= t2.site_id

ang tanong :
Ano ang ibig sabihin ng ("*=") sa Where Clause na yan... ? Bago kasi yung operator sa paningin ko eh..
 
Re: Comboboxes!!!

example di mo alam ung field name
SELECT *FROM Table_name (* is selecting all fields in your table)

Hindi siguro.

-> what I mean is , hindi siya nakalagay sa SELECTION dun siya sa "WHERE CLAUSE".

Example.

WHERE t1.site_id *= t2.site_id

ang tanong :
Ano ang ibig sabihin ng ("*=") sa Where Clause na yan... ? Bago kasi yung operator sa paningin ko eh..


Another way of implementing "Join" in Transact-SQL yan.

Ex.
This statement

select *
from titles, titleauthor
where titles.title_id *= titleauthor.title_id

is same below

select *
from titles left join titleauthor
on titles.title_id = titleauthor.title_id
 
bos..gusto ko sana gagawa ng app na nahit maka received lang ng text galing sa broadband ko.. may tutorial po ba kayu or guides how to do it?.. tnx..
 
Re: Comboboxes!!!

-> what I mean is , hindi siya nakalagay sa SELECTION dun siya sa "WHERE CLAUSE".

Example.

WHERE t1.site_id *= t2.site_id

ang tanong :
Ano ang ibig sabihin ng ("*=") sa Where Clause na yan... ? Bago kasi yung operator sa paningin ko eh..

old style join yan hindi na ginagamit ngayon

*= left outer join
=* right outer join
 
bos..gusto ko sana gagawa ng app na nahit maka received lang ng text galing sa broadband ko.. may tutorial po ba kayu or guides how to do it?.. tnx..

use the search tool sa thread na to, meron discussion nyan dito
 
Private Sub populateGrid()
dgvRecord.Rows.Clear()
Try
Dim ssQl As String = "SELECT StudentProfile.IDNumber,Lastname,Firstname FROM StudentProfile INNER JOIN ClassRecords ON StudentProfile.IDNumber = ClassRecords.IDNumber"
Using con As New OleDb.OleDbConnection(_gstrConnectionString)
Dim cmd As New OleDb.OleDbCommand(ssQl, con)
con.Open()
Dim rdr As OleDb.OleDbDataReader = cmd.ExecuteReader

While rdr.Read()
Dim sRow(3) As String
sRow(0) = rdr.Item("IDNumber").ToString.Trim
sRow(1) = rdr.Item("Lastname").ToString.Trim
sRow(2) = rdr.Item("Fistname").ToString.Trim
sRow(3) = rdr.Item("Year").ToString.Trim
sRow(4) = rdr.Item("Section").ToString.Trim
sRow(5) = rdr.Item("Adviser").ToString.Trim

dgvRecord.Rows.Add(sRow)
End While

con.Close()
End Using
Catch ex As Exception
MessageBox.Show("ERROR:" & ex.Message.ToString, My.Application.Info.Title, MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try


End Sub



anu po error dto bat nkkuha ako ng "No value given for one or more required parameters"?
please pahelp po
 
Private Sub populateGrid()
dgvRecord.Rows.Clear()
Try
Dim ssQl As String = "SELECT StudentProfile.IDNumber,Lastname,Firstname FROM StudentProfile INNER JOIN ClassRecords ON StudentProfile.IDNumber = ClassRecords.IDNumber"
Using con As New OleDb.OleDbConnection(_gstrConnectionString)
Dim cmd As New OleDb.OleDbCommand(ssQl, con)
con.Open()
Dim rdr As OleDb.OleDbDataReader = cmd.ExecuteReader

While rdr.Read()
Dim sRow(3) As String
sRow(0) = rdr.Item("IDNumber").ToString.Trim
sRow(1) = rdr.Item("Lastname").ToString.Trim
sRow(2) = rdr.Item("Fistname").ToString.Trim
sRow(3) = rdr.Item("Year").ToString.Trim
sRow(4) = rdr.Item("Section").ToString.Trim
sRow(5) = rdr.Item("Adviser").ToString.Trim

dgvRecord.Rows.Add(sRow)
End While

con.Close()
End Using
Catch ex As Exception
MessageBox.Show("ERROR:" & ex.Message.ToString, My.Application.Info.Title, MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try


End Sub



anu po error dto bat nkkuha ako ng "No value given for one or more required parameters"?
please pahelp po

Saang table galing ang Lastname,Firstname?

Try mo ganito,

Dim ssQl As String = "SELECT StudentProfile.IDNumber, StudentProfile.Lastname, StudentProfile.Firstname FROM StudentProfile INNER JOIN ClassRecords ON StudentProfile.IDNumber = ClassRecords.IDNumber"

bahala kanalang if StudentProfile or ClassRecords ang table na gamit mo.
 
Saang table galing ang Lastname,Firstname?

Try mo ganito,



bahala kanalang if StudentProfile or ClassRecords ang table na gamit mo.

sa StudentProfile po . natry ko na po yan eh. ganun parin.. pahelp po please :praise:
 
Back
Top Bottom