|
There are many ways to extract information, first you need to identify the index of the record you want to extract.
We can use the ME.Databindingcontext( datasource ).position to identify the current row.
Normally we assign a table to a datagrid's datasource, but here we will use the Table.Defaultview.
SO given TBL1 as your table
Datagrid.datasource = TBL1.Defaultview
then we can use
Me.BindingContext(TBL1.DefaultView).Position()
to indentify the current row, this should work even it you change the sort field of the datagrid.
I think thats it.
<br />
Dim ID As String<br />
<br />
'use the this event handle<br />
Private Sub DataGrid1_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles <br />
DataGrid1.CurrentCellChanged<br />
Dim x As Int16<br />
<br />
'Datagrid1.datsource = tbl1.Defaultview<br />
' instead of Datagrid1.datsource = tbl1<br />
' you must explicitly point to the tables defaultview <br />
<br />
'Get the position of the Table's Defaultview<br />
x = Me.BindingContext(TBL1.DefaultView).Position()<br />
<br />
'use x to identify you row<br />
ID = TBL1.DefaultView(x)("fieldname")<br />
End Sub<br />
Marvin N. Guerrero
- Taje Kage_bunshinNunJutsU
|
|
|
|
|
Thanks,
I'm using a DataGridTableStyle and for the MappingName it only seems to work if the MappingName equals "TBL1" instead of "TBL1.DefaultView". Is this correct?
|
|
|
|
|
How can I add a password for my setup?
So that the end-user must enter a passwrod/license ley before installation.
Marvin N. Guerrero
- Taje Kage_bunshinNunJutsU
|
|
|
|
|
ooops. he he .. 'i meant password/license key'
-dumb and dumber-
Marvin N. Guerrero
- Taje Kage_bunshinNunJutsU
|
|
|
|
|
Hello all,
I have a C++ console application written in .NET that I would like for to output to a Window as opposed to the DOS window.
Thanks!
|
|
|
|
|
Move it into a .NET dll, and then you can call it from VB.NET, and use VB.NET to show the output.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I did this once by redirecting stdout of the console to a stream with my GUI program. This works, but I would concur with the previous reply, that using a DLL is the right way to go. This is what I did, with quite a few ommisions.
Dim myProcess As Process = New Process()
Public sIn As System.IO.StreamWriter
Public sOut As System.IO.StreamReader
Public sErr As System.IO.StreamReader
'setup the process
'...
'...
myProcess.Start()
sIn = myProcess.StandardInput
sOut = myProcess.StandardOutput
sErr = myProcess.StandardError
Kevin
|
|
|
|
|
I program in VB.net , i do not know to catch a event that is raised when have a new file .csv in one folder.
Can you tell me.
Thanks
|
|
|
|
|
|
Have used the keyboard hooks from
http://www.developer.com/net/vb/article.php/10926_2193301_3
Looks great but having a strange problem whenever the form loads the browser dose not navigate unless i remove the hooks anyone know whay this is happening
On form load the following is run
Code=> Dim Urladd As String
Code=> Urladd = "http://www.google.ie"
Code=> WebBrowser1.Navigate(New Uri(Urladd))
Code=> HookKeyboard()
when the form closes
Code=> UnhookKeyboard()
Code=> Me.Close()
Seb ....
|
|
|
|
|
Disable the web browser and now the issue is just the hooks dose anyone else have VS-2005 to try run the code ???
|
|
|
|
|
Hi VB/Oracle expert!!
How can I utilize VB to read Oracle database?
Thanks a bunch,
icdavid
|
|
|
|
|
Yep have a look at this
Namespace: System.Data.OracleClient
OracleConnection
http://msdn2.microsoft.com/en-us/library/system.data.oracleclient.oracleconnection.aspx
OracleCommand
http://msdn2.microsoft.com/en-us/library/y051k82s(en-US,VS.80).aspx
OracleCommandBuilder
http://msdn2.microsoft.com/en-us/library/0ca0k1ad(en-US,VS.80).aspx
Example
The following example uses the ExecuteReader method of OracleCommand, along with OracleDataReader and OracleConnection, to select rows from a table.
Public Sub ReadMyData(ByVal connectionString As String)
Dim queryString As String = "SELECT EmpNo, DeptNo FROM Scott.Emp"
Using connection As New OracleConnection(connectionString)
Dim command As New OracleCommand(queryString, connection)
connection.Open()
Dim reader As OracleDataReader = command.ExecuteReader()
Try
While reader.Read()
Console.WriteLine(reader.GetInt32(0) & ", " _
& reader.GetInt32(1))
End While
Finally
' always call Close when done reading.
reader.Close()
End Try
End Using
End Sub
|
|
|
|
|
Is there a good way to put an animated jpg stream on a windows form?
Lots of IP cameras use this format with a java applet to view in a webpage... Just wondering if there was a good way to view this stream from vb.net and skip the java.
Joe
|
|
|
|
|
I don't have the proper answer for you but I know "for sure" that if you look in the windowsmedia SDK you'll find what you're looking for. Probably even the DirectX has some classes for that.
|
|
|
|
|
I have Kept an UltraGrid Infragistics control to vb.net form to display data from database. Now i want to export the data from ultra grid to Word document.
If anyone know how to do this please help me.
Millions of Thanks in advance
sreeja
|
|
|
|
|
hellow to all
i do not know if it is right to post my msg in this forum , if not tell me so and direct me to the right one ...
where can i find information about , creating Application that will recive an SMS messages from mobile phone , and send back information for the same phone ...
if anyone know a keyname fro this tech , or any site that can direct me to ..
thxx ..
|
|
|
|
|
This forum is specific to vb.net so your question could be appropriate if you are to use that language.
Let's suppose you're about that ... if you look around here you should find some code for handling SMS under vb.net. Just type SMS in the search box here and you'll get several articles that procide a good starting point
|
|
|
|
|
I have many radio button lists with the options YES and NO. I am trying to get it display or hide a text boxes below depending on whether the user checks YES or NO. However, because I have many radio button lists on my page, I do not want to use the autopostback feature because it will keep on bringing me to the top once the command is ran.
I got it to work using the OnSelectedIndexChanged command with the autopostback but I find it annoying to scroll down all the time to continue.
Is there anyway I can get this to work without using the autopostback feature?
Thy
|
|
|
|
|
You can only do this in client-side JavaScript. You cannot do it using VB.NET. Any code you write on the server side will require a postback to the server in order to work.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
And how would I do that? I have try using client side programing but i need to use a web control textbox becasue I have to save the info in the textboxes to my database.....
THanks
Thy
|
|
|
|
|
I have no idea since I can't remember that much Java. You might want to try asking in the Web Development or ASP.NET Forums. But this is most definately beyond the reach of server-side ASP.NET code.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
Can any body tell me how to read a text file in visual basic 6.The file contains the data not more then 2k.
Thanks in advance,
|
|
|
|
|
<br />
Public Function ReadTextFile(sFileName As String) As String<br />
Dim iFileNum As Integer<br />
Dim bFileOpen As Boolean<br />
<br />
' Activate error trapping.<br />
On Error GoTo Catch<br />
<br />
' Read text file.<br />
ReadTextFile = ""<br />
iFileNum = FreeFile<br />
Open sFileName For Input Access Read As #iFileNum<br />
bFileOpen = True<br />
ReadTextFile = Input(LOF(iFileNum), iFileNum)<br />
Close #iFileNum<br />
bFileOpen = False<br />
Exit Function<br />
<br />
Catch:<br />
' An error occurred. This will happen if file was not found.<br />
If bFileOpen Then Close #iFileNum<br />
End Function<br />
<br />
<br />
Public Sub Test()<br />
Dim sText As String<br />
<br />
sText = ReadTextFile("c:\MyPath\MyFile.txt")<br />
End Sub<br />
-- modified at 14:07 Monday 14th November, 2005
|
|
|
|
|
hellow to all ..
what method should i use to link 2 strings ?
let's say the string name str1
i wana link str1 to "an a string"
thxx
|
|
|
|