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!

first i created my table details..
i just group them per column dun sa first pic ko
https://img2.uploadhouse.com/fileuploads/25147/25147272b09c592899091e9d63c2d0aeb6345b75.jpg


then here's my priveledges
https://img3.uploadhouse.com/fileuploads/25147/251472736ab747a5842839ea5bfc8025c6432a0a.jpg


pag dating sa vb naman, every open ng form, they always requery or get their priveledges to make it real time,
para pag binago ng admin yung account mo, on the spot, kahit nakalogin ka, di mo na agad maaaccess yung ilang parts sa system

- - - Updated - - -



yan ang hirap pag hindi ka object oriented.. sandamakmak na textbox ang ipapasa mo imbis na yung object nalang



Paano po ba yong diskarte sir.. paturo naman ng other way sir
 
kuha ko na yong code ko sir.. anyway thanks po sasuggestions.. pinag aralan ko lng po paano.. na curious kasi sa ano ba yong LINQ.. mas mdali sia sir..

Salamat po..

ito ng pala kulang sa code ko ..

'------------------------
dbcon.tblppmps.submitchanges()

sa baba ng try catch..

salamat po..problem solve na po..salamat d2 sa suggestions sir.. try ko din po to,,
'---------------------------------------
 
mga sir baka may makatulong, nag aaral kasi ako ng vb.net, at yung system na pinapractice ko ngaun ay Daily Time Record System . Problem ko lang is yung code sa time-out , gumamit ako ng update code for the specific row, problema ko lang nag update lahat ng row even the previous days. bka my makatulong.


Dim sqlconn As New OleDb.OleDbConnection
Dim sqlquery As New OleDb.OleDbCommand
Dim connString As String
connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\guestuser.CFOOP\Documents\Visual Studio 2013\Projects\Time In-Out\WindowsApplication6\Time In-Out.accdb"
sqlconn.ConnectionString = connString
sqlquery.Connection = sqlconn
sqlconn.Open()
sqlquery.CommandText = "UPDATE [000550001] SET [EmpTimeOut] = '" & Label5.Text & "' "
Me.DataGridView1.Columns(3).DefaultCellStyle.Format = "hh:mm:ss tt"
sqlquery.ExecuteNonQuery()
sqlconn.Close()
View attachment 1201694

- - - Updated - - -

Nag try ulit ako gumawa ng system ng parking, yung automatic nyang pipiliin ung pinakamalapit na parking slot, eto nmn error ko., limited lang ba ang use ng Button.PerformClick() , dalawang beses lang kasi sya gumagana, sa mga next ayw na gumana. hanggang dalawa lang. sa pangatlo ayw na, sana may makatulong.


Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
PictureBox4.Visible = False
PictureBox5.Visible = False
PictureBox6.Visible = False
PictureBox7.Visible = False
PictureBox8.Visible = False
PictureBox9.Visible = False
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
PictureBox4.Visible = True
Label1.Text = "Occupied"
End Sub

Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
If PictureBox4.Visible = False Then
Me.Button1.PerformClick()
ElseIf PictureBox4.Visible = True Then
Me.Button2.PerformClick()
ElseIf PictureBox5.Visible = True Then
Me.Button3.PerformClick()
ElseIf PictureBox6.Visible = True Then
Me.Button4.PerformClick()
ElseIf PictureBox7.Visible = True Then
Me.Button5.PerformClick()
ElseIf PictureBox8.Visible = True Then
Me.Button6.PerformClick()
Else : MessageBox.Show("No Slot Available")
End If
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
PictureBox5.Visible = True
Label2.Text = "Occupied"
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
PictureBox6.Visible = True
Label3.Text = "Occupied"
End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
PictureBox7.Visible = True
Label4.Text = "Occupied"
End Sub

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
PictureBox8.Visible = True
Label5.Text = "Occupied"
End Sub

Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
PictureBox9.Visible = True
Label6.Text = "Occupied"
End Sub

End Class


View attachment 1201737

Yung update query sir, lagyan mo ng WHERE clause, Ex. "UPDATE [000550001] SET [EmpTimeOut] = '" & Label5.Text & "' WHERE EmpID = '" & EmpIDTextBox.Text & "'" kung yung employee id gagamitin mo make sure na unique yung value ng empid row sa database mo hehe

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

about sa button.performclick(). i think sa if else statement mo yan. try mo paghiwahiwalayin ex.
If PictureBox7.Visible = True Then
Me.Button5.PerformClick()
End If

If PictureBox8.Visible = True Then
Me.Button6.PerformClick()
End If

suggestion lang sir hehe :thumbsup:
 
mga ts..may problema aq sa query ko..edplain ko ha
meron aq 2 tables.. ang isa sa items, ang isa sa purchase

bawat items na ma register sa items table
at bawat items na ma purchased sa purchased table,
so ang question ko is.. halimbawa meron aq

item_table quantity office name na nagrequest to purchased
1. bond paper 5 office1
2. printer 5 office2
3. ballpen 10 office3


sa
table_purchased o mga na purchased is
1.bond paper 3 office1
2. printer 3 office2
3. ballpen 5 office3
4. ballpen 3 office2
5. ballpen 2 office1


ano po bang query sql code d2 na ang gusto ko po ay ma select nia lahat ng na purchased na item at magbawas sa items table na database at mag combined yong mga office na nag request for purchased..

ganito result ohh..

consuladated table

item_name items_left office_name
1.bond paper 2 office1
2. printer 2 office2
3.ballpen 5 office1/office2/office 3 kac sila yong nag request ng ballpen..

need po ng analyst o sa mga best programmers.. COMSCI anD I.T EXPERT..


possitive response..

bluepearl.
Edit / Delete Edit Post Quick reply to this message Reply Multi-Quote This Message Add To Quote Reply With Quote Reply With Quote Report Post
Sponsored Post

- - - Updated - - -

mga ts..may problema aq sa query ko..edplain ko ha
meron aq 2 tables.. ang isa sa items, ang isa sa purchase

bawat items na ma register sa items table
at bawat items na ma purchased sa purchased table,
so ang question ko is.. halimbawa meron aq

item_table quantity office name na nagrequest to purchased
1. bond paper 5 office1
2. printer 5 office2
3. ballpen 10 office3


sa
table_purchased o mga na purchased is
1.bond paper 3 office1
2. printer 3 office2
3. ballpen 5 office3
4. ballpen 3 office2
5. ballpen 2 office1


ano po bang query sql code d2 na ang gusto ko po ay ma select nia lahat ng na purchased na item at magbawas sa items table na database at mag combined yong mga office na nag request for purchased..

ganito result ohh..

consuladated table

item_name items_left office_name
1.bond paper 2 office1
2. printer 2 office2
3.ballpen 5 office1/office2/office 3 kac sila yong nag request ng ballpen..

need po ng analyst o sa mga best programmers.. COMSCI anD I.T EXPERT..


possitive response..

bluepearl
 
Panu ang pag call ng events like meron ako 3 forms which is Main form, Form1 and from2. Main form contains buttons to load form 1 and form2, my problem is how to initiate button perform click in main form to load form 2 while you are in form1? gamitin ko lang sa MDI child to MDI child to MDI parent.


Button edit Code for form1

private void btnEdit_Click(object sender, EventArgs e)
{
if (this.dgvListEmployee.SelectedRows.Count > 0)
{

string edit = dgvListEmployee.SelectedRows[0].Cells[0].Value + string.Empty;
var AddEmp = new frmAddEmployee();
SetValueForText1 = edit;
SetValueForText2 = "Update Record";
AddEmp.Text = "Update Record";
AddEmp.FormClosed += new FormClosedEventHandler(frmListEmployee_FormClosed);
AddEmp.Show();
this.Hide();
}
else
{
MessageBox.Show("Please select the entire row to edit record");
}
}


pero ginawa ko is eto pero ayaw mag load si form2

private void btnEdit_Click(object sender, EventArgs e)
{
if (this.dgvListEmployee.SelectedRows.Count > 0)
{

string edit = dgvListEmployee.SelectedRows[0].Cells[0].Value + string.Empty;
var AddEmp = new frmAddEmployee();
var main = new frmMain();
SetValueForText1 = edit;
SetValueForText2 = "Update Record";
AddEmp.Text = "Update Record";
AddEmp.FormClosed += new FormClosedEventHandler(frmListEmployee_FormClosed);
AddEmp.MDIParent = main;
Addemp.Topmost = true;
AddEmp.Show();
this.Hide();
}
else
{
MessageBox.Show("Please select the entire row to edit record");
}
}


code ko naman sa main form to load form1 and form2
load from1
frmListEmployee lemp;
private void btnListEmp_Click(object sender, EventArgs e)
{

if (Vlemp == "")
{
lemp = new frmListEmployee();
lemp.MdiParent = this;
this.BackColor = Color.White;
lemp.TopMost = true;
lemp.Show();
Vlemp = "visible";
}
}


load form2

private void btnAddNewEmp_Click(object sender, EventArgs e)
{
var emp = new frmAddEmployee();
SetValueForText1 = "Add New Record";
emp.Text = "Add New Record";
emp.MdiParent = this;
this.BackColor = Color.White;
emp.TopMost = true;
emp.Show();
}


balack ko nalang sana is i perform click yung Main Form btnAddNewEmp_Click sa form1 to load form 2


howww!!!!
 
Panu ang pag call ng events like meron ako 3 forms which is Main form, Form1 and from2. Main form contains buttons to load form 1 and form2, my problem is how to initiate button perform click in main form to load form 2 while you are in form1? gamitin ko lang sa MDI child to MDI child to MDI parent.


Button edit Code for form1

private void btnEdit_Click(object sender, EventArgs e)
{
if (this.dgvListEmployee.SelectedRows.Count > 0)
{

string edit = dgvListEmployee.SelectedRows[0].Cells[0].Value + string.Empty;
var AddEmp = new frmAddEmployee();
SetValueForText1 = edit;
SetValueForText2 = "Update Record";
AddEmp.Text = "Update Record";
AddEmp.FormClosed += new FormClosedEventHandler(frmListEmployee_FormClosed);
AddEmp.Show();
this.Hide();
}
else
{
MessageBox.Show("Please select the entire row to edit record");
}
}


pero ginawa ko is eto pero ayaw mag load si form2

private void btnEdit_Click(object sender, EventArgs e)
{
if (this.dgvListEmployee.SelectedRows.Count > 0)
{

string edit = dgvListEmployee.SelectedRows[0].Cells[0].Value + string.Empty;
var AddEmp = new frmAddEmployee();
var main = new frmMain();
SetValueForText1 = edit;
SetValueForText2 = "Update Record";
AddEmp.Text = "Update Record";
AddEmp.FormClosed += new FormClosedEventHandler(frmListEmployee_FormClosed);
AddEmp.MDIParent = main;
Addemp.Topmost = true;
AddEmp.Show();
this.Hide();
}
else
{
MessageBox.Show("Please select the entire row to edit record");
}
}


code ko naman sa main form to load form1 and form2
load from1
frmListEmployee lemp;
private void btnListEmp_Click(object sender, EventArgs e)
{

if (Vlemp == "")
{
lemp = new frmListEmployee();
lemp.MdiParent = this;
this.BackColor = Color.White;
lemp.TopMost = true;
lemp.Show();
Vlemp = "visible";
}
}


load form2

private void btnAddNewEmp_Click(object sender, EventArgs e)
{
var emp = new frmAddEmployee();
SetValueForText1 = "Add New Record";
emp.Text = "Add New Record";
emp.MdiParent = this;
this.BackColor = Color.White;
emp.TopMost = true;
emp.Show();
}


balack ko nalang sana is i perform click yung Main Form btnAddNewEmp_Click sa form1 to load form 2


howww!!!!
Try mo lang sir, not sure kung gagano to haha and di rin ito yung best way hehe
Sa main form mo yung button click event gawin mong public
Ex. public void button1_Click(object s, EventArgs e) { ... }

MainForm:
Public void ...... {
new Form3().Show();
}

Sa form 1:
Private void ... {
MainForm frm = new MainForm();
frm.button1_Click(button1, null);
}
Yung button1 sa loob ng parameter is yung button na icclick sa Form1

Sana makatulong hahaha
 
paano ko to ma translate sa LINQ CODE in vb.net?

Select tblppmp.idn
,tblppmp.total_item as a_total
,tblRequest.Quantity as b_total
,tblppmp.total_item - tblRequest.Quantity as itemsleft
FROM ppmp.dbo.tblppmp
INNER JOIN
(SELECT
tblrequest.idn
,sum(tblRequest.Quantity) AS Quantity
FROM ppmp.dbo.tblrequest
WHERE tblrequest.dr_year = 2015
GROUP BY tblrequest.idn) tblrequest ON tblppmp.idn = tblrequest.idn

ito sample code ko
Dim req_view_item = From item In dbcon.tblPPMPs _
Join request In dbcon.tblREQUESTs _
On item.IDN Equals request.IDN _
Select New With {item.IDN, item.GenDes, request.PRNO}
req_dgv.DataSource = req_view_item

ei nakaklito..baka may idea kayo
 
help dko convert ung system.io.fileinfo into string
 

Attachments

  • vbnet.jpg
    vbnet.jpg
    187.4 KB · Views: 19
help dko convert ung system.io.fileinfo into string

Sir yung "FF" nyo is FileInfo Class .. mageerror po talaga sya kasi hindi sya string


"File.Delete(file path)" ... ang pagkaalam ko po path ang ilalagay nyo dyan, kung i-hover
nyo yung mouse nyo sa FF dapat yung laman nun is something like this "C:\Application\Test\Crusade.Jpg"


try nyo pong gawin "FF." then check nyo yung mga laman na magiging file path
 
Last edited:
Im currently developing a system which inlcudes Barcode scanning, ano po suggested type ng barcode scanner na fit gamitin or traditional nang ginagamit sa vb.net???
 
Im currently developing a system which inlcudes Barcode scanning, ano po suggested type ng barcode scanner na fit gamitin or traditional nang ginagamit sa vb.net???

barcode scanning? sa system ko kase, ewan ko lang, kasi yung barcode scanner parang keyboard lang din ang dating.. babasahin lang nya yung barcode then parang ittype lang nya.. imbis na itype mo yung productID non, yung barcode scanner na yung gagawa, no need for Software Development Kit(SDK), mostly pa plug and play lang

- - - Updated - - -

paano ko to ma translate sa LINQ CODE in vb.net?



ito sample code ko


ei nakaklito..baka may idea kayo

i dont use Ling To SQL and Entity Framework..,
mas trip ko kasi yung dapper.. xD

https://github.com/StackExchange/Dapper

ganito ko sya gamitin

25245999e23f0e13cccce171545634ff20570a51.jpg


25246000f5ea63570ae4ca26006ee9acf9ed42d1.jpg


- - - Updated - - -

saka pag aralan nyo yung tinatawag na 3-Tier or Layer Architecture, pampadali ng buhay yon :)
 
barcode scanning? sa system ko kase, ewan ko lang, kasi yung barcode scanner parang keyboard lang din ang dating.. babasahin lang nya yung barcode then parang ittype lang nya.. imbis na itype mo yung productID non, yung barcode scanner na yung gagawa, no need for Software Development Kit(SDK), mostly pa plug and play lang

Thanks sa reply sir, question ko lang if plug and play na sya , wala nang iimport na .dll sa vb.net as in diretso na pag naka focus sa textbox automatic send sya ng keys ?
 
Last edited:
Thanks sa reply sir, question ko lang if plug and play na sya , wala nang iimport na .dll sa vb.net as in diretso na pag naka focus sa textbox automatic send sya ng keys ?

try mo sa notepad.. mag ttype kusa yon at enter.. :) so same lang din sa textbox mo..
 
Back
Top Bottom