Outside Computers

Sunday, March 28, 2010

Demonoid Codes

I will be giving 5 invitation codes. But please follow the rules and regulation of demonoid. In torrents mostly on demonoid, you cannot be always downloading files, you must be able to seed also, not LEECH, so if you cannot seed then you cannot join demonoid.

If you are willing to help to seed more in demonoid , i will give you the invitation code.

in order to give you the code you must comply with me.
1. Email me through your main email account
2. tell me your username
3. follow the rules
4. Contact info
you can email me here. lickweed_21@yahoo.com

Monday, March 22, 2010

Adding items in combo boxes from mysql database in vb.net

In this post, I will give some sample codes on how to populate your combo box from your database using datasets.

In this example code, I will use MYSQL as my database and VB.net 2005 teamsuite.

First part of the code: we write a code on setting up a connection on our database and here it is.
Dim dataset1 As DataSet = New DataSet
Dim dataadapter1 As MySqlDataAdapter = New MySqlDataAdapter

Dataset this is where we will put all the data that we will get from our datasources
Dataadapter this is our connection or bridge to our connection object and our dataset


2nd part : Getting the data from the database

Dim msql As String = "Select EmpId from tblempinfo" 'SQL query to select what data will be shown in the combo box
myda1.SelectCommand = New MySqlCommand(msql, mysqlcon) 'will trigger the selected sql query to get the data we needed


3rd Part: filling up the Combo box

myda1.Fill(myds1) 'the data adapter will fill our dataset to hold the data
cboEmp.DataSource = myds1.Tables(0) 'this code will connect the combo box and the database using datasets ,setting up a data source.
cboEmp.DisplayMember = "EmpId" 'this will filter what data to be displayed on the combo box
cboEmp.ValueMember = "EmpId" 'this will set or get the actual value of the displayed member.



I hope this sample code will help you

Enjoy Coding.



On the next post : setting up the reports from the selected value on the combo box

Thursday, March 18, 2010

Crystal Reports VB.net how to connect them

In this post, this will show you how to connect these 3 programs namely : VB.net , Crystal Reports XI, first is you can add a crystal report viewer object so that it can browse some crystal report files , then after adding the viewer, you can now set the report source of the viewer either by wizard or by coding it.

the sample code is like this


Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.SelectedIndex = 0 Then
Me.Close()
Form2.Show()
Form2.CrystalReportViewer1.ReportSource = Application.StartupPath + "\reports\CrystalReport3.rpt"
Else
Form2.Show()

this code above will set the report source or the report that will be printed on the report viewer depending on what the user selected in the combo box.

Form2.CrystalReportViewer1.SelectionFormula() = "{tblsched.EmpId} = '" & TextBox1.Text & "'"
Form2.CrystalReportViewer1.ReportSource = Application.StartupPath + "\reports\CrystalReport2.rpt"
End If
End Sub

the 2nd quoted code shows what data will be shown depending on the value of the textbox then you can choose what report will be printed by selecting an item in the combo box.


Note: You can add you created reports in the vb.net proj so that it will accept the application.startuppath code, you can place the reports inside the bin directory

if there's some problem in this tutorial just post here your comment or leave a message

enjoy coding!!

Wednesday, March 17, 2010

Welcome

Guys

this blog is all about helping newbie programmers out there, i hope this blog will help you and if you have some problems regarding in your programs you can post it here and i would gladly help you