|
i think i got it to work, with help from this article
------------------------
Jordan.
III
|
|
|
|
|
i recently created a file in C:\ using system.IO.FileStream and was told that if i want a datagrid to save and load automatically when the program is closed and opened I would have to source it to an object and have the object do so. i am not familiar with objects. what objects should be used. does xml have to be used? the grid is just like a check book register so the user can type in it.its blank except for the column headers. and i want the data the user inputs to be saved and loaded as the program is opened and closed.
your help is greatly appreciated
|
|
|
|
|
If you go back and read the reply post again, you'll find that the "object" your talking about is a DataSet . The docs for which are here[^] on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How do you rotate a picture in an imagebox or picture box by 90degrees
Donald
|
|
|
|
|
Try read the information from here.[^]
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
How can I pack MSDE with my application and check if MSDEexist and then automatically install database.
|
|
|
|
|
As far as I know, you could not do that. I think I might see this kind of question before in this forum and some people tell them to try bootstrapper... I'm not sure too.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Hello everybody. I am trying to retrive data from a Access Database containing two tables.
1) tblKeyword
2) tblArea
In tblKeyword there are two attributes: a) Keyword and b) AreaName
in tblArea there are couple including AreaName which is the connection between the two tables.
I am trying to use the following code:
========================================================================
Dim strConnection As String = OleDbConnection1.ConnectionString
Dim connect As New OleDbConnection(strConnection)
Dim test As String
Dim te As String
Dim SQLString As String
connect.Open()
te = cmbKeywords.Items(cmbKeywords.SelectedIndex)
On Error Resume Next
SQLString = "SELECT tblKeywords.Keyword, tblArea.AreaName, tblArea.StartDate, tblArea.JobNumber FROM tblKeywords INNER JOINT tblArea ON tblKeywords.AreaName = tblArea.AreaName WHERE tblKeyWords.Keyword =" & "'" & te & "'"
Dim cmd As New OleDbCommand(SQLString, connect)
Dim reader As OleDbDataReader = cmd.ExecuteReader()
While reader.Read()
txtAreaName.Text = reader.GetValue(1)
End While
========================================================================
The SQL command goes through OK but the reader.Read is causing an error. How can i retrive the data from that SQL. I am lost.
I know that the GetValue gets a value from attributes in one table. But with the inner joint I need values from both tables.
Any help would be appreaciated. Thank you..
Still trying to find the way
|
|
|
|
|
Chaos Machine wrote:
The SQL command goes through OK
What you mean is that you are able to create the SqlCommand, however no validation is done on the provided SQL string provided at this point.
Chaos Machine wrote:
but the reader.Read is causing an error
At the point of opening the datareader, the SQL provided is executed, so any syntactical errors will be thrown here.
Chaos Machine wrote:
INNER JOINT
Now, if that were my mistake it would've been freidian
Oh, and another pointer:
Chaos Machine wrote:
I know that the GetValue gets a value from attributes in one table. But with the inner joint I need values from both tables.
By doing an join, you are effectively creating one table (albeit a virtual table that doesnt exist in the DB). Your single table will have the columns you specify in the select list:
Chaos Machine wrote:
SELECT tblKeywords.Keyword, tblArea.AreaName, tblArea.StartDate, tblArea.JobNumber
Hope it helps.
|
|
|
|
|
Hello J4amieC,
thanks for replying. I am still at a loss of what to do. Can you please show me with a bit of code how I can retrive the informations that i have collect from the SQL command? I am trying from books and online info, but still nothing. Thank you for your help.
Still trying to find the way
|
|
|
|
|
OK,
my comment was that you had a error in your SQLString (you used INNER JOINT instead of INNER JOIN) it should read:
SQLString = "SELECT tblKeywords.Keyword, tblArea.AreaName, tblArea.StartDate, tblArea.JobNumber FROM tblKeywords INNER JOIN tblArea ON tblKeywords.AreaName = tblArea.AreaName WHERE tblKeyWords.Keyword ='" & te & "'"
Now when you execute this string you will have the following columns:
0: Keyword (from tblKeywords)
1: AreaName (from tblArea)
2: StartDate (from tblArea)
3: JobNumber (from tblArea)
so if you use:
reader.GetValue(0)
you will get the Keyword column.
|
|
|
|
|
Thank you J4amieC it worked!!! Thank you so much. Now i have to expand this so when i have two areas with the same keyword a list is populated. Hmmm lets see if i can do it!! LOL
Thank you again for your help...
Still trying to find the way
|
|
|
|
|
How can I get the handle of an app that doesn't have a form?
Pablo.ar
|
|
|
|
|
No window means no hWnd either. What are you trying to do?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm trying to make a screensaver... Wait, let me rephrase that: I swear I'm trying to make a screensaver.
With this program, you'll be able to set whatever program to run when the ssvr execs (using the Shell function) or whatever file, to be loaded by the system (using the ShellExecuteEx function, that needs an hWnd to execute).
So...
Pablo.ar
|
|
|
|
|
I still don't know why you need a hWnd to a window that doesn't exist. Why are you trying to get this?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok I got what you're looking for.
Try using a handle to another window that is actually availible.
I mean that i.e. use the GetForgroundWindow() API to get an availible handle and pass it to ShellExecute. Or you can use the handle to the Desktop window, etc.
Hope it helps.
|
|
|
|
|
The 'desktop window' is a great idea, I'll investigate if there is such a thing, or something similar (with a handle!) that I can use.
Thanks a lot, MohammadAmiry.
Pablo.ar
|
|
|
|
|
well i want my windowform to be invisible but i want to be-able too make it visible again. u can make a message box and all, but does anyone know how to make a icon appear in the |Start ToolBar|?
thank ya
|
|
|
|
|
Can you specify how you make it invisible?
Have you setted an icon to the form?
Also, consider investigating the .ShowInTaskBar property.
Best regards,
Pablo.ar
|
|
|
|
|
well it won't be really invisible just Minimized in the start tool bar, but in the tool bar the program will still fun until u open in from the tool bar and click stop.
Ex. say A instant messager, it still runs eeven though u x-ed it out. (runs in the start toolbar, until u click "signoff".
you see what i am saying?
|
|
|
|
|
Anyone know how to convert from an Icon file to a Cursor file?
Thanks,
Tim
|
|
|
|
|
There are lots of tools dwelling on the net.
I use Conware's IconArt[^] which is freeware .
Cheers,
Pablo.ar
|
|
|
|
|
Dim Ico As Icon = My.Resources.NomeIcona
Me.Cursor = New Cursor(Ico.Handle)
|
|
|
|
|
I have a datagrid bound to a typed dataset. I can obtain the value of the cell by setting the data set to the row and field of the datagrid. i.e.
Form1.CaseLookUpFromGrid =
Caselookds1.tblCases(DataGrid1.CurrentCell.RowNumber).CaseNumber
The problem comes when the the sort function of the datagrid us used. The dataset is not sorted so the value returned is the value that was in the datagrid cell prior to the sort.
Is there a way to obtian the value of a cell in a datagrid? This seams like somthing that should be simple.
Nick
|
|
|
|