|
You need to declare 3 class variables in your form class.
private currentStudent as student
private intCurrentRecord as integer
private intRecordcount as integer
While loading the records you need to increment intRecordcount for each record.
When finished loading the student records set intCurrentRecord to 0.
You then need to declare a function to set the records i.e.
Private Sub SetRecord()
If intRecordCount >= 0 Then
currentStudent = Students(intCurrentRecord)
txtFirstName.Text = currentStudent.firstName
txtLastName.Text = currentStudent.lastName
txtTele.Text = currentStudent.tele
txtGPA.Text = currentStudent.gpa
End If
End Sub
After setting intCurrentRecord call SetRecord which will give you the first student
loaded into the text boxes.
Ideally, instead of just a next button for scrolling through the records, you should
have 4 buttons, i.e Next, Previous, First, and Last buttons.
In each of these button events, increase or decrease intCurrentRecord as appropriate,
and then call SetRecord. i.e.
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
If intCurrentRecord < intRecordCount - 1 Then
intCurrentRecord += 1
SetRecord()
End If
End Sub
Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click
If intCurrentRecord > 0 Then
intCurrentRecord -= 1
SetRecord()
End If
End Sub
Private Sub btnFirst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFirst.Click
intCurrentRecord = 0
SetRecord()
End Sub
Private Sub btnLast_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLast.Click
intCurrentRecord = intRecordCount - 1
SetRecord()
End Sub
Hope this helps
|
|
|
|
|
zimvbcoder, Thanks for all your HELP!!! I appreciate all ur help and time.
|
|
|
|
|
|
Hello to all,
Actually i m selecting the Font of Monotype Corsiva with the Style of Reguler. but after selecting it works for Italic.
Code is Given below. Valuefont is Fontdialog box .
If valuefont.ShowDialog = Windows.Forms.DialogResult.Cancel Then Exit Sub
font1 = New Font(valuefont.Font.Name, valuefont.Font.Size, valuefont.Font.Style)
Try to get the answer. why.
If you can think then I Can.
|
|
|
|
|
What are the values of those 3 variables you're passing in to the Font constructor? What does the code look like that's defining those variables and values?
|
|
|
|
|
Check the code which is give above. In Which Valuefont is dialogbox. And the value is passed from Dialog Box. The Error is generating while we select Morovia Corica and Select Style Regular.
If you can think then I Can.
|
|
|
|
|
That doesn't answer the question. Have you VERIFIED what those values are?
|
|
|
|
|
You Can Check For
Try
{
Dim Font1 as Font = New Font (Monotype Corsiva,12,Regular)
}
Catch
{
}
If you can think then I Can.
|
|
|
|
|
|
Why would you need a "SOAP interface" to store data in a database? There's something you're not saying about your concept that needs to be explained for this to make any sense. I mean, a login screen just takes a username and password. It's simple to lookup a username and compare the password enter to the one stored, wihtout using SOAP at all.
|
|
|
|
|
It's not a login screen on a website. I am creating a touch screen to login to when you enter an office.
|
|
|
|
|
So what? That doesn't change anything. All those questions still stand.
|
|
|
|
|
I am creating a screen where one will enter their name and phone number. I want this info to go into the database.
|
|
|
|
|
For the last time...What do you think a "SOAP Interface" is and why do you think you need it??
|
|
|
|
|
When you say a "SOAP interface" presumably you mean a web service?
The answer is, as always, "it depends..." What sort of database are you using? You can expose database functionality for Oracle and SQL Server as a web service and call it directly, but I don't think you can do that with MySQL (for example) so in that case you will need something else in the mix to handle the web service layer.
|
|
|
|
|
Hi!
Any one to help me giving the vb.net code for automated mobile message reading system connected with com port
|
|
|
|
|
Noone is just going to hand you code. You actually have to write it yourself and if you get stuck with a specific problem, we'll help you solve it. If you've just come here to get code, you've come to the wrong site.
|
|
|
|
|
ok i know What was the mistake thanks for your time anyway.
I found a good tutorial in youtube (I dont mean that your tutorial is bad)
i just thought that Youtube will be the last thing i can find what i am seeking for.
It all was my mistake so should i delete this Message"It's ok if you delete it for me i dont needit"?
This is the code i used it worked anyway(FINALLY):
i had to do a class to make this work
Public Class AppConfigReader
Private Shared SettingsReader As New System.Configuration.AppSettingsReader
Private Shared spamTXT_ As String = SettingsReader.GetValue("spamTXT", GetType(String))
Private Shared PNtext_ As String = SettingsReader.GetValue("PNtext", GetType(String))
Private Shared Itext_ As String = SettingsReader.GetValue("Itext", GetType(Byte))
Private Shared EF_ As String = SettingsReader.GetValue("EF", GetType(Byte))
Private Shared HS_ As String = SettingsReader.GetValue("HS", GetType(Byte))
Public Shared ReadOnly Property spamTXT() As String
Get
Return spamTXT_
End Get
End Property
Public Shared ReadOnly Property PNtext() As String
Get
Return PNtext_
End Get
End Property
Public Shared ReadOnly Property Itext() As Byte
Get
Return Itext_
End Get
End Property
Public Shared ReadOnly Property EF() As Byte
Get
Return EF_
End Get
End Property
Public Shared ReadOnly Property HS() As Byte
Get
Return HS_
End Get
End Property
End Class
the config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings >
<add key ="SpamTXT" value ="000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"/>
<add key ="PNtext" value ="Warcraft III"/>
<add key ="Itext" value ="50"/>
<add key ="EF" value ="1"/>
<add key ="HS" value ="1"/>
</appSettings>
</configuration>
i could use all the value in my program like this :
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SpamedTXT.Text = AppConfigReader.spamTXT
PNtxt.Text = AppConfigReader.PNtext
Itxt.Text = AppConfigReader.Itext
EF.CheckState = AppConfigReader.EF
HS.CheckState = AppConfigReader.HS
End Sub
this code was for a spammer that i made 2 days ago i am making a program that can remap and stuff like that
Joseph.
modified on Thursday, November 26, 2009 5:40 AM
|
|
|
|
|
Well there is probably a lot of articles on this on CodeProject. So I do not think saying "your tutorial" is going to help in the slightest as "your" could be anyone.
|
|
|
|
|
Articles are supported by the people who wrote them. There is a forum at the bottom of each article where you can post questions about it.
If what you posted is accurate, then you've named the App.Config file incorrectly. It is not App.Code, it's App.Config.
What article are you talking about?
Also, the key "Vault" is not part of the Configuration section schema, so it's not going to work at the level you're showing in your post.
After-Darkness wrote: AssAssin-AOK@hotmail.com
Noone cares about your email address except spammers. Posting your email address will only get you tons and tons of spam in your mailbox.
|
|
|
|
|
OK, now you've changed your post.
What part of my answer makes me so mean??
After-Darkness wrote: I SUCK OK iam SORRY IF U DONT LIKE .with my all respect Dave Kreskowiak YOU ARE SO MEAN
|
|
|
|
|
Probably because you didn't write all the code for him
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
i have a table with th schema
productid int
productname varchar
productattribute xml
where the productattribute is supply by user through form say (<size>12<maker>seagate)
how can i deserialize this on the fly so i can say
product.productattribute.size =12
|
|
|
|
|
Ebube wrote: how can i deserialize this on the fly so i can say
product.productattribute.size =12
This doesn't make sense to me. Are you asking how you can set the value of a property that doesn't exist at design time?? You can't, since, obviously, the size property doesn't exist. It must be defined in the class before you can use it.
You can do something more like this:
product.productattribute("size") = 12
IF this is what you're really trying to do...
|
|
|
|
|
thanks Dave Kreskowiak
actually am looking for a way to break up this attribute so that i can have a report that look like
ram
size 256 maker seagate
price 50
note that this value exit in database but size and maker are nodes in the (xml productattribute column)
|
|
|
|