|
|
I may be wrong in this but you have 'Exit Function' before 'accessinfo=f' to the function is trying to return to its caller before the object has been set. Why not try removing the 'Exit Function' and the 'accessinfo=f' and just replace it with 'Return f'?
|
|
|
|
|
Your Exit Function is preventing the "accessinfo = f" assignment from executing. Once you fix that, you will have to add "Set" to the object assignment. - "Set accessinfo = f".
Tom Garth
Developer
R. L. Nelson and Associates, Inc., Virginia
|
|
|
|
|
hi
i am facing one problem at the time of desinging 2 combobox from one datasource & one datatable. my data table contains following fields -
item_code | length | rate
xyz | 1000.00 | 2.0
bnm | 500.00 | 1.0
qwe | 300.00 | 0.50
i have to select rate for the selected item code & selected length. for this i am desiging two combobox separately but after selection of 2nd combo popup contents of 1st combo clearing. is there any solution using multicolumn combo or datagridview in 2005 ? if yes - how?
plz. help me
Thanks
bye
|
|
|
|
|
Each combo requires its own separate dataview as the datasource. The two dataviews 'point' to the same table. If you don't do this then each combo is using the table's default dataview as the datasource and a selection in one combo then affects the contents of the other.
-- modified at 10:26 Sunday 19th August, 2007
|
|
|
|
|
hi
thanks. my problem is solved using two data sets to access same datatable twice. i was doing same datasets to access same table twice.
bye.
Thanks
bye
|
|
|
|
|
Hi,
Try this...
Dim dvItemCode as New DataView(DataTable)
Dim dvLength as New DataView(DataTable)
Dim dvRate as New DataView(DataTable)
ComboBox1.DataSource = dvItemCode
ComboBox1.DisplayMember = "Item_Code"
ComboBox1.ValueMember = "ID"
ComboBox1.DataSource = dvLength
ComboBox1.DisplayMember = "Length"
ComboBox1.ValueMember = "ID"
...
Hope this helps
|
|
|
|
|
hi
thanks for immed. reply & sorry for late reply
i have done like u said but it shows one error -
Error - 'can not bind to the new display member.'
ParameterName : newdisplaymember
my code is as follows -
con.connectionstring = con_str
da_combo1.selectcommand =new sqlclient.sqlcommand
da_combo1.selectcommand.connection = con
str_sql = "select * from dbo.rate_mas"
da_combo1.selectcommand.commandtext = str_sql
da_combo1.fill(ds,"rate_mas")
dim dt as datatable = new datatable("rate_mas")
dim dvitemcode as new dataview(dt)
dim dvlength as new dataview(dt)
dim dvrate as new dataview(dt)
combo1.datasource = dvitemcode
combo1.displaymember = "item_desc"
**** it shows the above said error for immed. following stmt
combo1.valuemember = "item_code"
******** error end
combo1.datasource = dvlength
combo1.displaymember = "length"
combo1.valuemember = "id"
what can i do to solve this error
bye
Thanks
bye
|
|
|
|
|
Hi,
first please make sure that you are not trying to assign columns of two different tables to ValueMember and DisplayMember. In your case you have to check that item_desc and item_code belong to rate_mas datatable.
Good luck
|
|
|
|
|
I am trying to use VB.Net as a front end for a MS Access database. I am trying to get the date/time into a format I want to use(displaying, modifying etc). I have the field in Access defined as date/time. I only want to use the time portion in 24hr format. My format is HH:nn:ss and the input mask reflects this. When I display one record in VB.Net, the date is the only thing that is showing and instead of showing today's date, it is showing a date from 30 Dec 1899. The data I already have stored in the Access database for that field is 23:55:00. What do I need to do in order to get it to work the way I would like?
|
|
|
|
|
You are displaying the date in the text box in the wrong format. You can reformat the date in a textbox like this:
Dim MyDate As DateTime = Me.TextBox1.Text
Me.TextBox1.Text = MyDate.ToLongTimeString()
How did you setup the Dataset, etc? (Wizard or code) There is probably a better way of doing it if you could explain.
Green2Go
|
|
|
|
|
I set up the dataset through a wizard. The only thing I have coded an event on closing to update the database.
Public Class frmSingle
Private Sub DataBindingNavigatorSaveItem_Click(ByVal _ sender As System.Object, ByVal e As System.EventArgs) _ Handles DataBindingNavigatorSaveItem.Click
Me.Validate()
Me.DataBindingSource.EndEdit()
Me.DataTableAdapter.Update _(Me.TandemsheetsDataSet.data)
End Sub
Private Sub frmSingle_FormClosing(ByVal sender As Object, _ ByVal e As System.Windows.Forms.FormClosingEventArgs) _ Handles Me.FormClosing
Me.DataTableAdapter.Update _(Me.TandemsheetsDataSet.data)
End Sub
Private Sub frmSingle_Load(ByVal sender As _ System.Object, ByVal e As System.EventArgs) Handles _ MyBase.Load
'TODO: This line of code loads data into
'the 'TandemsheetsDataSet.data' table. You can
'move, or remove it, as needed.
Me.DataTableAdapter.Fill _ (Me.TandemsheetsDataSet.data)
End Sub
End Class
|
|
|
|
|
Does your format really have "nn", or is that just a typo?
Tom Garth
Developer
R. L. Nelson and Associates, Inc., Virginia
|
|
|
|
|
It was "nn" because that is what Access used as the minute placeholder in the custom format. Access probably uses it to distinguish from the month for which it uses mm. At least it is working that way.
I think I might have found what I am looking for though.
In VB on the properties for the textbox I am using, I changed the Format property to Custom and changed the CustomFormat property to HH:mm:ss. It works the way I want it to now. Thanks to Tom and green2go for attempting to help me.
|
|
|
|
|
hello everyone..
i have a little problem with loading wmf file (wmf is richtext format)
if loads from file everithing works
Dim i As Image = Image.FromFile("c:\1.wmf")
but if loads from memory array nothing happen
Dim s1 As New MemoryStream()
Dim a() As Byte
Dim i As Image
a = My.Computer.FileSystem.ReadAllBytes("c:\1.wmf")
s1.Write(a, 0, a.Length)
i = Image.FromStream(s1, True, True)
if i switch file to bmp or jpg everythings fine
please help
|
|
|
|
|
Hi,
a stream has some kind of pointer inside of it, telling it where the next
read or write is going to happen. Where do you think it points after
you did s1.Write(a, 0, a.Length) ? Read up on MemoryStream to find the cure !
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
thank you.. everything is OK now
but i dont understand why jpg works fine?!
|
|
|
|
|
Spejlo wrote: but i dont understand why jpg works fine?!
with exactly the same code ???
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
yes.. only file change to jpg
|
|
|
|
|
Hi,
MSDN on Image.FromStream() states: The stream is reset to zero if this method is
called successively with the same stream.
I did test this on a stream containing two JPEG; and later two GIF; it always
reads the first image twice, i.e. I can't read the second image !!
I don't have WMF in stock.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
A WMF is not an image, it's vector information. The Metafile class is what he needs to use.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi Christian,
I was not aware of the Metafile class, but it seems to inherit from Image.
And Wmf is just one of the ImageFormat members. So I would expect it to behave
like Jpeg and Gif as far as FromFile and FromStream go, but that is not what
the original poster was saying.
I'll try with some WMF files soon.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
So, I'd expect an Image instance can be a Metafile, but you probably need to call the Metafile constructor, or FromFile method, to load a metafile.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
To load an image, set the PictureBox's Image property to a new Bitmap object initialized by the image file's name.
' Load a file.
Private Sub mnuFileOpen_Click(ByVal sender As _
System.Object, ByVal e As System.EventArgs) Handles _
mnuFileOpen.Click
If dlgOpen.ShowDialog() = DialogResult.OK Then
picImage.Image = New Bitmap(dlgOpen.FileName)
Me.Width = picImage.Width + Me.Width - _
Me.ClientSize.Width
Me.Height = picImage.Height + Me.Height - _
Me.ClientSize.Height
Dim file_name As String = dlgOpen.FileName
file_name = _
file_name.Substring(file_name.LastIndexOf("\") _
+ 1)
Me.Text = "[" & file_name & "]"
dlgSave.FileName = dlgOpen.FileName
End If
End Sub
http://www.thehitcounters.com
Free Hit Counter, Website Counters by The Hit Counters
Custom Logo Design Services by http://www.thebusinesslogo.com
modified on Wednesday, May 6, 2009 6:16 AM
|
|
|
|
|
Hi John,
The OP has a problem with Image.FromStream not being consistent, and not conforming
to its documentation.
We all know how to read an image file and how to display it, that was not the issue.
BTW: some of us don't like a PictureBox much.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|