|
i want the code for fetchin recods ... Plzz tell me the code
Paritosh Tripathi
B.Tech. (C.S.)
|
|
|
|
|
It's not that easy!
First you need to create a connection object and set it's properties, connection string etc.
Then you need to setup your dataset tables and relationships/constraints etc
Then you can create your DataAdapters or command objects to retrieve your data and place it in your dataset. From there, you can bind it to your form controls.
If you are a beginner, as you stated, you will learn more by finding out for yourself by reading the help topics in Visual Studio or MSDN.
I will help you with any particular thing you don't understand but it is far too complicated to just give you all the code for what you ask.
You have to do some of the work yourself!
Steve
|
|
|
|
|
i've done all the necessary things just binding the records is left where i'm facing the prob i already used MSDN for help.. only thing is bindin .. i've created a Table named info where name, rollno,fname,sex,marital status etc r the fields.. i've also written the code in Module n database connection is already established now wat code shud i write to bind the form with tables...
Paritosh Tripathi
B.Tech. (C.S.)
|
|
|
|
|
You need to do something like this:
Private Sub POPULATE_Controls
With YourDataSet.Tables("YourTable").Rows _
(Me.BindingContext(YourDataSet, "YourTable").Position)
ControlName.Text = IIf(IsDBNull(.Item("YourFieldName")), "", _
.Item("YourFieldName"))
'Repeat for each field/control
End With
End Sub
Unless you are doing it all in the designer (datasets etc) then you can bind through the properties window. I always do it in code.
To view the next record, you will need to create your navigation buttons and adjust the BindingContext position, then call POPULATE_Controls again.
Steve
-- modified at 15:48 Wednesday 2nd August, 2006
|
|
|
|
|
thnx STEVE i got it now.
Paritosh Tripathi
B.Tech. (C.S.)
|
|
|
|
|
Well done! Pleased I could help.
Steve
|
|
|
|
|
are u familiar with SQL statements?
if yes use the select statement to retreive and display data
Nothing lasts but nothing is lost
|
|
|
|
|
Hi
I have a DataGrid with comboboxes (inherited from DataGridTextBoxColumn) and I'm woundering what methods or something runs when a user clicks in the DataGrid or ComboBox. In the comboboxes I use the KeyUp event for the user to choose an item in the combobox. When I choose an item with keys nothing happens, but when I click and choose an item in my combobox a new row appear in the DataGrid and that is what I want to happen.
Is there someway I can get the same thing to happen whether I click or press
keys in the combobox.
Here is the code for using the keys to choose an item in the comboboxes
Private Shadows Sub IntelliCmb_KeyUp(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) Handles ColumnComboBox.KeyUp
Dim index As Integer
Dim actual As String
Dim found As String
If ((e.KeyCode = Keys.Back) Or _
(e.KeyCode = Keys.Left) Or _
(e.KeyCode = Keys.Right) Or _
(e.KeyCode = Keys.Up) Or _
(e.KeyCode = Keys.Down) Or _
(e.KeyCode = Keys.PageUp) Or _
(e.KeyCode = Keys.PageDown) Or _
(e.KeyCode = Keys.Home) Or _
(e.KeyCode = Keys.ShiftKey) Or _
(e.KeyCode = Keys.Tab) Or _
(e.KeyCode = Keys.F2) Or _
(e.KeyCode = Keys.End)) Then
Return
End If
If e.KeyCode = Keys.Enter Or e.KeyCode = Keys.Delete Then
If ColumnComboBox.Text = "" Then
mblnEditing = True
End If
Return
End If
actual = ColumnComboBox.Text
index = ColumnComboBox.FindString(actual)
If (index > -1) Then
ColumnComboBox.SelectedIndex = index
ColumnComboBox.SelectionStart = actual.Length
ColumnComboBox.SelectionLength = found.Length
If ColumnComboBox.SelectedIndex <> 0 Then
mblnEditing = True
End If
End If
Please, I need help!!!!
Fia
|
|
|
|
|
Hi, I have a list view which display the following data:
ID Name Sex
001 John Male
002 Michael Male
003 Janny Female
For example: why I click on the second row (ID: 002) it will return all information (ID, Name and sex) to the text box and I can update it. Does anyone has the sample to identify which row is select in list view. I need the code in vb.net.
Thank
|
|
|
|
|
ListView.SelectedIndices will return the index of the seletced row.
Example:
Integer = myListView.SelectedIndices
If multi-select is enabled, it will return an index for each row selected. In which case you would use an array to store the values.
Steve
|
|
|
|
|
Dear Steve,
Thank you very much for your solution. I will try to use/customize your above code and if I have any problem I will return back to this forum and ask for the solution.
Thank
|
|
|
|
|
Hi, I already test your code and now I could get the row number that I select from the list view. But now I need you help on how to get the item of the select row? For example the 2nd row of my list that I select contain the followin form:
Name Sex
Janny Female
John Male (This is the row that I selected)
I could i get the value from the first column and the second column when I select the specific row? Please give me a sample code.
|
|
|
|
|
I'm not sure about this but I think the following will work in your example:
Integer = myListView.SelectedIndices
myListView.Items(Integer).Text 'gets the first column text
myListView.Items(Integer).SubItems(ColumnIndex).Text 'gets the column specified by ColumnIndex
Change 'ColumnIndex' to represent the subitem column whose text value you want to retrieve.
Steve
|
|
|
|
|
Thank you steve, I will try to use this code and let you know if I have any problem with it.
|
|
|
|
|
Hi all,
i have a problem here, can anyone please guide me more?
I want to click on a title which will link itself to open a pop up window that shows a checklist of things. How can i go about writing the codes to make a window pop up with all the contents i want inside?
Thanks in advance for taking up your time.
frossie
|
|
|
|
|
Just create the popup form and put your contents(such as checkbox, etc).
Remember your new form's name. Example: frmPopup
In Designtime.. doubleclik the title you to assign as triger to popup your content form.
in Click procedure just add a single code:
frmPopup.Show ()
Thats all..
|
|
|
|
|
Hello, I am trying to list all the URLs from a RichTextBox containing source code from a web page. They need to be stored in an SQL or Access database.
I am using Visual Basic.NET and i need some help, please.
Thanks
Aaron
|
|
|
|
|
Easiest way would be to cut/paste them yourself...
You want to create a function that strips URL's from web page source code?
Are you sure that is legal/ethical?
Steve
|
|
|
|
|
I don't know Steve, but I'm trying to write a search engine and need a program to index hyperlinks into a database, Google did it.
I would much appreciate any help though, thanks.
Aaron
|
|
|
|
|
Ok. You may want to have a look at the Split function using 'space' as the delimiter.
You could put each word into an Array or ArrayList.
Loop the Array/ArrayList and look for words beginning 'http' or containing 'www' using the InStr function or something similar.
Steve
|
|
|
|
|
OK, I will give it a go. Thanks;)
Aaron
|
|
|
|
|
You may want to find the first instance of a URL before assigning anything to your array. Just to keep the array size down.
You will probably need to use an ArrayList since it's capacity will increase dynamically and you don't know what the size will be.
You should probably strip as much out as you can before populating your ArrayList.
Steve
|
|
|
|
|
Sorry if I'm being a bit annoying but, I was just wondering if it would be easier to use RichTextBox1.DetectURLs, because I have no idea on how to use the ArrayList, I'm not the best at VB.NET in the world
But I'm trying. Thanks though
Aaron
|
|
|
|
|
Nice idea but I'm afraid that is a property not a method.
Its purpose is to automatically format a Uniform Resource Locator (URL) when it is typed into the control.
Steve
|
|
|
|
|
I think I will try again with your idea, thanks;)
Aaron
|
|
|
|