|
If this is all you're doing, why are you supplying the SQL commands yourself??
Just give the SELECT command to get the data, then use an OleDbCommandBuilder[^] to create the rest of the commands for you.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: If this is all you're doing, why are you supplying the SQL commands yourself??
Well, let's say it's an ADO.NET newb mistake...
Anyway, using OleDbCommandBuilder it works flawlessly.
Thanks a lot
|
|
|
|
|
how to insert a flash movie in vb.net?(it is possible in old VB(vb6))how it possible in vb dot net 2005?
fff
|
|
|
|
|
how to create dockable menu(dock menu) in vb.net?i want to create a menu like the Menu tool box in vb.net.(side menu).for this i create a left menu with pull down property. but i can't dock it(need to hide it till the mouse pointer comes out and appears when mouse comes in )................ please reply
fff
|
|
|
|
|
Hi All,
I have two files IDX and FIM file. I scan images in put their information Location and size in IDX file and FIM while contains actual data about images.
I am displaying image using ImageMan. Which needs two things address of image memory block and image size.
In dataGridView I am displaying infromation about all image records it has.
On Click on each row in DataGridView I wanted to display image in ImageMan AciveX. I wrote below code but some time it works some time it gives error bad memory handle.
Please let me know ASAP what should I do to fix it.
Regards,
Vivek
Private Sub dgvImageData_RowEnter(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvImageData.RowEnter
Dim iFimLoc As Integer = 0
Dim iFimSize As Integer = 0
iFimLoc = Convert.ToInt32(dgvImageData.Rows(e.RowIndex).Cells("FimLoc").Value)
iFimSize = Convert.ToInt32(dgvImageData.Rows(e.RowIndex).Cells("FimSize").Value)
Dim fsFimFile As New FileStream(vFimFileName, FileMode.Open, FileAccess.Read)
Dim brFimReader As New BinaryReader(fsFimFile)
Dim fimBufferRead As Byte()
Dim gh As GCHandle
Dim AddrOfImageData As IntPtr
Me.mtxtErrorMessage.Text = ""
Me.mtxtErrorMessage.Update()
Try
fimBufferRead = Nothing
brFimReader.BaseStream.Seek(iFimLoc, SeekOrigin.Begin)
'Dim soundHandle As IntPtr = fsFimFile.Read(fimBufferRead, iFimLoc, iFimSize)
fimBufferRead = brFimReader.ReadBytes(iFimSize)
gh = GCHandle.Alloc(fimBufferRead, GCHandleType.Pinned)
AddrOfImageData = gh.AddrOfPinnedObject()
gh.Free()
Me.AxImageManOcx.Picture = ""
Me.AxImageManOcx.AutoScale = ImvbLib.enumAutoScale.Stretch
Me.AxImageManOcx.ScaleMethod = ImvbLib.enumScaleMethod.AntiAlias
Me.AxImageManOcx.ImageDataSize = iFimSize
Me.AxImageManOcx.hImageData = AddrOfImageData
Me.AxImageManOcx.Refresh()
Me.mtxtErrorMessage.Text = AddrOfImageData.ToString()
Catch ex As Exception
Me.mtxtErrorMessage.Text = ex.ToString()
Finally
brFimReader.Close()
fsFimFile.Close()
fimBufferRead = Nothing
End Try
Me.mtxtErrorMessage.Update()
End Sub
Vivek Gupta
|
|
|
|
|
I have Starting position and Image size. Based on these two value I wanted to know what is the memory address of Starting position in memory file.
This information is required to display image with ImageMan OCX. Above code sometime display image correctly and sometime it return bad handle error.
so I am wondering what is wrong with it?
|
|
|
|
|
I want to ensure tht only 3 or less strings are entered in a masked textbox.
How would I go about doing this?
Thank you
Nothing lasts but nothing is lost
|
|
|
|
|
Do you mean three or less characters?
You can control the number of characters using your mask. For instance select the mask as provided format "numeric (5 digits)" and delte two 's from the mask will limit the control to accepting 3 numbers.
|
|
|
|
|
No i mean 3 strings, its a textbox allowing for the entry of a store's name, here stores have a maximum number of 3 strings in their names.
Im generating a unique ID for each store and i need to ensure that only 3 or less strings are entered(this also requires that a space is not entered after the last string).
Thank you
Nothing lasts but nothing is lost
|
|
|
|
|
Uhhhh, I think your using the wrong terminology. A MaskedEditBox can only hold one string. An example of what you mean by "3 strings" would help.
I'm assuming you mean that the user would be typing in something like this:
InfoPiece1 Info2 InfoP3
This is all one string. You'll have to parse the string and split it into the 3 strings you're looking for.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have done that already and inserted them into arrays whereby i generate an ID. I have also entered validation for a user entering more than 3 words in the textbox.
The problem occurs if a user enteres a space after the last word then the validation reads it as more than 3 words and brings up the validation message.
Thank you
Nothing lasts but nothing is lost
|
|
|
|
|
Then Trim the string before you parse it. This will remove all white-space characters from the beginning and end of the entered text.
Dim parseThis As String = enteredText.Trim()
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you
Nothing lasts but nothing is lost
|
|
|
|
|
Hi,
I want to send command to card printer through my application in VB.
Printer is connect on the parallel port with port name "ELTNLPT".
Can anybody guide me that how could I send the following command from
my application in VB?
&E1 639357000000001^SHARIQ ZIA^0909
This is the command to write Track 1 information on the magnetic stip
of card.
Urgent reply will be highly appreciated.
Thanks,
Shariq Zia
|
|
|
|
|
Hi,
Is it possible to populate a combo-box from an excel sheet using Vb.net
thanks
|
|
|
|
|
yes. You need to read the data from the excel file and populate the combo box.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi,
Could anyone tell me how to detect the play of a video file (any video file like AVI, WMV, MPEG etc...)?
If any application (like RealPlayer or Windows Media Player) plays the video file, my application should recieve a notification.
Thanks in advance,
Pavan
Regards,
Pavan
|
|
|
|
|
There's no way to do this. There is no notification event that gets fired by anything when a video file is played.
What are you trying to do with this?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks a lot for your reply.
Purpose: On detecting a video play, I have to set the preferred resolution of the screen automatically for the best view.
Can we hook on directx dll and try to get a notification when DirectX starts Rendering Video?
I heard of injecting code into third party DLL's but I have never worked on it. Will this idea work out for detecting the video play?
Please help me.
Regards,
Pavan
|
|
|
|
|
No, this won't work because DirectX isn't used to play video in all cases. There is simply no reliable way to tell when video is being played by any player.
And changing screen resolution is a VERY bad idea. If you change the screen resolution, the icons on the desktop get rearranged. Messing with system-wide settings for a single application is considered very bad practice.
-- modified at 8:15 Thursday 10th August, 2006
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks Dave for your reply.
|
|
|
|
|
hi
i have a package developed in vb.net.how can i deploy the embeded crystal report of my project to the client machine using vb.net code?when ever i ll run my program in client machine it will ask for the login information from registry.bt from that registry value,how can i set the login information of reports that i already ve been developed in another machine having different server,password & database name.please explain it with an example
u can send me the source code at pradipta_pkc@indiatimes.com
any suggestion in this regard will be highly appreciated
thanking u all in advance
i m pradip kumar from india,working in vb.net & asp.net
|
|
|
|
|
How can I populate a Treeview from Ms Access database which contains tables of :-
1. Parent (parent_id, parent_name)
2. Child (child_id, child_name)
3. ParentChildRelation (id, parent_id, child_id)
The reason that I cannot use single parent-child table is I have child with multiple parents and parent with multiple child (M-to-M). How do I solve this in populating a treeview? Any sample demo with source code?
|
|
|
|
|
I have done something similar to this.
I made one table that contained the data I wanted all in one table, all in order. The data had a three level hierarcy (Parent - 1, child - 2, grandchild -3). So when I looped through the table I would check the level and create a node accordingly.
Private Sub PopulateNavigationTree()<br />
TopicTreeView.BeginUpdate()<br />
<br />
TopicTreeView.Nodes.Clear()<br />
<br />
Dim parentNode As TreeNode<br />
Dim childNode As TreeNode<br />
'Dim fullPath As String<br />
<br />
Dim iLevel As Integer = 0<br />
<br />
Dim baseNode As TreeNode = TopicTreeView.Nodes.Add("Topics")<br />
<br />
' init to valid values for safety<br />
parentNode = baseNode<br />
childNode = baseNode<br />
<br />
Dim myRow As DataRow<br />
If m_TreeDataSet.Tables.Count > 0 Then<br />
If m_TreeDataSet.Tables(0).Rows.Count > 0 Then<br />
<br />
For Each myRow In m_TreeDataSet.Tables(0).Rows<br />
iLevel = CType(myRow.Item("Level").ToString, Integer)<br />
If iLevel = 1 Then<br />
parentNode = baseNode.Nodes.Add(myRow.Item("Topic").ToString)<br />
ElseIf iLevel = 2 Then<br />
childNode = parentNode.Nodes.Add(myRow.Item("Topic").ToString)<br />
Else<br />
childNode.Nodes.Add(myRow.Item("Topic").ToString)<br />
End If<br />
<br />
<br />
Next<br />
End If<br />
<br />
Else<br />
' TO DO: add error message here<br />
End If<br />
TopicTreeView.CollapseAll()<br />
baseNode.Expand()<br />
TopicTreeView.EndUpdate()<br />
End Sub<br />
|
|
|
|
|
Hi,
almost done with my project (I thought...)
functionality is 100%, but I don't wanna put "best viewed on MY computer" on the bottom of the page...hehe
But when I try to view it in 1024*768 it looks awful...
And 800*600 is even worse (so bad u couldn't even click some of the buttons)
I need help, and general tips on how I can now modify things to fit for crappy resolutions (=> 1024*768 and 800*600)
I had been using absolute positions..
Now I've come to the conclusion I need to use pixels for text sizes...
The goal I think would be to get it to fit PERFECT for 1024 at least, and 800*600 users should be used to crap anyway...
(although I would like it to be usable for them too, this is a professional app and I cannot say "bha f' em")
Just not sure how to get on with this, any general tips or links will be very appreciated...
Please help..?
|
|
|
|