|
Saba02 wrote: System.Data.SqlClient.SqlException: String or binary data would be truncated.
Your column don't have enough capacity to hold the binary data. Try incresing the column's allowed space.
|
|
|
|
|
It's been a few days and I have not been able to figure out my mistake. I have 2 combo boxes I want the two combo1 as the parent and combo2 to be the child.
Private Sub btnOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpen.Click
Dim strProvider As String = "Microsoft.Jet.OLEDB.4.0"
Dim strConnect As String
Dim cnn As OleDbConnection
Dim cmd As OleDbCommand
Dim odr As OleDbDataReader
Dim da1 As OleDbDataAdapter
Dim da2 As OleDbDataAdapter
' Connect to unsecured Access database
strConnect = String.Format("Provider={0};Data Source={1};", strProvider, txtPath.Text)
'Initialize the DataSet object
Dim ds As New DataSet()
'Create Command object
Dim cmd1 As String = "SELECT * FROM ER"
Dim cmd2 As String = "SELECT * FROM Thickness"
Try
' Retrieve and open a connection.
cnn = New OleDbConnection(strConnect)
cnn.Open()
'Initialize the DataAdapter object and set the SelectCommand property
da1 = New OleDbDataAdapter(cmd1, cnn)
da2 = New OleDbDataAdapter(cmd2, cnn)
'Populate the DataSet
da1.Fill(ds, "ER")
da2.Fill(ds, "Thickness")
' Define the relationship between the tables.
ds.Relations.Add(New DataRelation( _
relationName:="relERThickness", _
parentColumn:=ds.Tables("ER").Columns("ER_ID"), _
childColumn:=ds.Tables("Thickness").Columns("ER_ID"), _
createConstraints:=False))
'Bind the DataTable to the ComboBox
ComboBox1.DataSource = ds
ComboBox1.DisplayMember = "ER"
'Bind the DataTable to the ComboBox
ComboBox2.DataSource = ds
ComboBox2.DisplayMember = "ER.relERThickness"
Catch exp As Exception
MsgBox(exp.Message)
Finally
If Not odr Is Nothing Then
odr.Close()
End If
If Not cmd Is Nothing Then
da1.Dispose()
da2.Dispose()
End If
If Not cnn Is Nothing Then
cnn.Dispose()
End If
End Try
End Sub
|
|
|
|
|
Begin PART 1 :
I have a sub
Private Sub PrintProperties(Of T)(ByVal pItem As T)
[...]
End Sub that I need to access it through MethodInfo :
Private Sub PrintPropertiesMaster(Of T)()
[...]
Dim method As MethodInfo = GetType(Form1).GetMethod("PrintProperties", _
(System.Reflection.BindingFlags.Instance _
Or (System.Reflection.BindingFlags.Public Or System.Reflection.BindingFlags.NonPublic)), _
Nothing, New Type() {GetType(T)}, Nothing)
[...]
End Sub but method is set to nothing after the previous line.
I'm sure I miss something in the Type.GetMethod parameters. Any idea?
End PART 1
Begin PART 2 :
Another way to achieve my goal could be to know how to specify a TypeParam dynamically.
Let me explain this with sample :
This is my not conforming code:
For Each oEnt As Entity In DefaultManager.GetEntities(Of SomeNameSpace.ObjOne)()
PrintProperties(Of SomeNameSpace.ObjOneDataRow)(CType(oEnt, SomeNameSpace.ObjOneDataRow))
Next
For Each oEnt As Entity In DefaultManager.GetEntities(Of SomeNameSpace.ObjTwo)()
PrintProperties(Of SomeNameSpace.ObjTwoDataRow)(CType(oEnt, SomeNameSpace.ObjTwoDataRow))
Next
'And so on
[...] I need to access it using a System.Type instead of TypeParam (Of Something )
(Consider that ObjOne Inherits from ObjOneDataRow and ObjTwo Inherits from ObjTwoDataRow.
In other words, ObjOneDataRow is the base class of ObjOne)
So one parameter should be enough to know all the needed System.Type to finish with something like this :
Private Sub PrintValues(Of T)()
For Each oEnt As Entity In DefaultManager.GetEntities(Of T)()
PrintProperties(Of GetType(T).BaseType)(CType(oEnt, GetType(T).BaseType))
Next
End Sub but this does not compile
End PART 2
Thanks for any help!!!
|
|
|
|
|
I get the error: "Invalid Parameter Used" when i try to display an image
I believe this occurs at DisplaySignPictureBox.Image = Image.FromStream(mem)
Try
Connect()
jesacmd = New SqlCommand("SELECT PER_SIGN FROM PER_INFO_SIGN WHERE PER_NAME
= '" & CheqOwnerComboBox.SelectedItem.ToString & "'", jesacon)
Dim da As New SqlDataAdapter(jesacmd)
Dim ds As New DataSet
da.Fill(ds, "PER_INFO_SIGN")
Dim c As Integer = ds.Tables("PER_INFO_SIGN").Rows.Count
If c > 0 Then
Dim jbyte() As Byte = ds.Tables("PER_INFO_SIGN").Rows(c - 1)("PER_SIGN")
Dim mem As New MemoryStream(jbyte)
DisplaySignPictureBox.Image = Image.FromStream(mem)
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
jesacon.Close()
modified on Tuesday, September 23, 2008 9:58 AM
|
|
|
|
|
In VB6 i want to display the dollar,pund and euro depending on the countries.I am using "SetLocaleInfo" function .I am having the error like "function not defined" .Please tell me how to define this function.thanks in advance
----------------------------------------------------------
Dim IntLocale As Integer
IntLocale = SetLocaleInfo(2057, 1, "H")
If (CurrCntryCode = "EP") Then
xlApp.ActiveSheet.Range("J" & NxtLine).NumberFormat = "€#,##0.00"
Else
If (CurrCntryCode = "HK") Then
xlApp.ActiveSheet.Range("J" & NxtLine).NumberFormat = "$#,##0.00"
Else
If (CurrCntryCode = "UK") Then
xlApp.ActiveSheet.Range("J" & NxtLine).NumberFormat = "£#,##0.00"
Else
xlApp.ActiveSheet.Range("J" & NxtLine).NumberFormat = "£#,##0.00"
GridFormatCellFunction("J" & NxtLine) = "Format,£#,##0.00"
End If
End If
End If
|
|
|
|
|
You're getting the message "function not defined" because you haven't defined SetLocaleInfo anywhere in your code.
|
|
|
|
|
Hi friends,
Can anyone tell me how to print current document using VB.net 2005.
Also tell me how can I format a report..
Thanks...
|
|
|
|
|
Hi, I need to convert Topographic Map/ Contour Map into another view like the image shown below in VB.net. The value of each contour line will be input by user which will be the value of Y. What I need is the way to extract the point which will be the value of X.
Sorry that I do not know how to describe the view I want to convert to.
Can anyone give me idea how to get it done?
|
|
|
|
|
Hi guys, i need help on my symbol mc1000 barcode scanner.
I would like to create an ascii file and store the scanned barcode (decoded) in that ascii file, together with the system date as i scan a barcode. the ascii file will then be downloaded to a pc for further processing.
Any help would be very much appreciated. Thanks.
|
|
|
|
|
jayv01 wrote: i need help on my symbol mc1000 barcode scanner.
I would like to create an ascii file and store the scanned barcode (decoded) in that ascii file, together with the system date as i scan a barcode. the ascii file will then be downloaded to a pc for further processing.
Write a form that will accept a text input and scan the bar code. You should now have the scanned data in the text box - write it out with the system date to file, and clear text box.
A bar code scanner is usually a keyboard wedge - it imitates a keyboard.
HTH
|
|
|
|
|
Hi ChandraRam,
Thanks for your reply. But the barcode scanner that i am using is not a keyboard wedge but a standalone barcode scanner. Basically, the scanning of barcodes will be done by batch and will just save the data in the scanner (Symbol MC1000). Once done, I will download the ascii file from the barcode scanner to the user computer for more processing.
Sandz
|
|
|
|
|
Hi All!
I need to have drag events on a webbrowser control that it does not currently provide, I've googled this, but can't seem to find a clear answer. Does anybody have any ideas on this?
Thanks!
MrWolfy
|
|
|
|
|
|
Hi and Thanks!
Thanks for the link! Problem Solved!
Thanks Again!
MrWolfy
|
|
|
|
|
|
hai all,
i am new to vb.i am using visual basic 6.0.
back end is microsoft access.
i want to get the datas from microsoft access database and list that datas in combobox or listbox.how to do this?...thanks in advance to all...
|
|
|
|
|
Where to begin?
- You need to buy a book on programming.
- You need to move to VB.NET, vb6 has been dead for several years
- You need to write some code and post it here when it doesn't work
Bob
Ashfield Consultants Ltd
|
|
|
|
|
hey ediet,;;;; i think you dont know anything about vb. i know want to buy book or not .
|
|
|
|
|
dileep.arangod wrote: hey ediet,;;;; i think you dont know anything about vb. i know want to buy book or not .
And I think you lack manners. The idea of CP is you write some code, and when it errors you post the code. At this point someone will try to help you.
1. If you do not know how to connect to a database and populate a list box then your understanding of vb is obviously very limited. This sort of code is very basic and therfore if you don't know the basics a book is the best bet.
2. Micrsoft stopped supporting VB6 several years ago, you can get the express version of VB 2008 free, so why bother using VB6?
Finally, if i am the ediet (idiot?) why is it you asking the question, not me.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
ok, thank you...Now your keeping manners. thanks for given the correct spell of "idiot".........bye
|
|
|
|
|
Hiii
rs.openrecordset("Select MyDate from MyTable")
for i=0 to rs.Eof
combobox1.items.add(rs!MyDate)
next
May be this helps you.
Thanx
Khatri Mitesh
|
|
|
|
|
I am trying to find a way to divide an image into equally squares. More precisly I would like to take the parts of the picture and place them in seperate picture boxes
|
|
|
|
|
I currently have a project regarding com port and i am new to serial port function. Is there anyone with example regarding this area??
|
|
|
|
|
Subjugate wrote: Is there anyone with example regarding this area
Yep. Google.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Start a project in VB, and add the component: MScomm Control.
Copy the icon of a telephone onto a form, then write some code to enable the COM port like:
MSComm1.Settings = "9600,n,8,1"
MSComm1.ParityReplace = ""
On Error GoTo COMerr
MSComm1.PortOpen = True
Exit sub
COMerr:
msgbox "A COM error occured:" & err.number & vbcrlf & err.description
End Sub
To send data out the COM port use:
MSComm1.Output = "This text string will go out the COM port."
To trap received data on the serial port, you must add this to the MScomm1.OnComm event:
dim TCin as string
if MSComm1.CommEvent = MSCOMM_EV_RECEIVE then
TCin = MSComm1.Input
msgbox Received: " & TCin
end if
You should also include these in a declarations file:
'--- MSComm event constants
Global Const MSCOMM_EV_SEND = 1
Global Const MSCOMM_EV_RECEIVE = 2
Global Const MSCOMM_EV_CTS = 3
Global Const MSCOMM_EV_DSR = 4
Global Const MSCOMM_EV_CD = 5
Global Const MSCOMM_EV_RING = 6
Global Const MSCOMM_EV_EOF = 7
'--- MSComm error code constants
Global Const MSCOMM_ER_BREAK = 1001
Global Const MSCOMM_ER_CTSTO = 1002
Global Const MSCOMM_ER_DSRTO = 1003
Global Const MSCOMM_ER_FRAME = 1004
Global Const MSCOMM_ER_OVERRUN = 1006
Global Const MSCOMM_ER_CDTO = 1007
Global Const MSCOMM_ER_RXOVER = 1008
Global Const MSCOMM_ER_RXPARITY = 1009
Global Const MSCOMM_ER_TXFULL = 1010
|
|
|
|