|
I try this code before but it didn't show the data either in textbox or in combobox?
Assaf
|
|
|
|
|
show me the code you tried, and I will try and help you work out what is going wrong, or someone else will :->
/jason
|
|
|
|
|
Is your code running in a separate thread?
-Jason
|
|
|
|
|
Private Sub Mouch_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Querry As String
Querry = "select * from mouchtarayat"
'the trial function take commandText, this function contain all the needed value to establish the connection.
trial(Querry)
'Dataset=ds
ds.Clear()
'DataAdapter=daM
daM.SelectCommand = cmd
Try
cnn.Open()
Catch ex As Exception
Finally
MessageBox.Show(cnn.State)
End Try
'fill the data into the appropriate place
daM.Fill(ds, "Mouch")
End Sub
Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged
'TextBox5.Text = ds.Tables(0).Rows(0).Item("التاريخ").ToString
TextBox5.DataBindings.Add("text", ds, "Mouch.")
'the two way didn't work
End Sub
Private Sub cmbNaw_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Naw.SelectedIndexChanged
cmbNaw.DataSource = ds.Tables("Mouch")
cmbNaw.DisplayMember = "النوع"
'Me.cmbNaw.DataBindings.Add("text", ds, "Mouch.النوع")
'the two way didn't work
End Sub
Thanks a lot in advance
Assaf
|
|
|
|
|
Assaf82 wrote:
TextBox5.DataBindings.Add("text", ds, "Mouch.")
Try this...
TextBox5.Text = ds.Tables(0).Rows(0).Item("التاريخ").ToString
TextBox5.DataBindings.Add("Text", ds.Tables("Mouch"), "التاريخ")
I am assuming that "التاريخ" is an Item of the Table "Mouch"
-Jason
|
|
|
|
|
Yes "التاريخ" is an Item of The Table "Mouch"
but the statment you just give me didn't work.
and to be sure that the dataset contain the appropriate table with the appropriate column i put some message to give the data inside:
Dim dt As DataTable
For Each dt In ds.Tables
'msgbox(dt.tablename)
Next
Dim dc As DataColumn
For Each dc In ds.Tables("mouch").Columns
MsgBox(dc.ColumnName)
Next
Dim drw As DataRow
For Each drw In ds.Tables("mouch").Rows
MsgBox(drw(1))
MsgBox(drw(2))
MsgBox(drw(3))
Next()
and all give me the right data
with my best regards
Assaf
|
|
|
|
|
The code I posted should work for your databinding.
If not, the only other thing I can think of is it dont like the Characters التاريخ . Try replacing them characters with the actual integer index of the column if you know what that would be.
-Jason
|
|
|
|
|
I go far,and i change all the database to an English one but no satisfied result, (i think if it's not written in english it cause trouble).
also i put instead of the name of the field his number, nothing different.
The think that make me confused in this problem that there no one give a real example about using this features without using the wizard to create the adapter,connection and the dataset, and if you try this using the wizard it done well.
With my best regards
Assaf
|
|
|
|
|
I want to validate a text box, that it only accept the numeric characters on key press/key down event. I dont want message boxes when any alpha character press.
Muhammad Ali Ghauri
ABN AMRO Bank N.V. - Pakistan
|
|
|
|
|
you need to handle your textbox's keyboard events, either keydown , keyup or keypress . Then check the contents of the textbox and delete any characters you don't want.
make sure you set the maxlength property because otherwise this will take some time
/jason
|
|
|
|
|
Can you please specify how this can be done. Sample code will be very useful.
With Best Regards,
Mayur
|
|
|
|
|
you can handle as follows
add keypress event to the textbox and add following code
If Char.IsNumber(e.KeyChar) Then
e.Handled = False
Else
e.Handled = True
End If
end if
happy programming
|
|
|
|
|
how i can change a default keyboard language input for specific column in a datagrid automatically??
|
|
|
|
|
Hello Friends,
Here i want to do mirror the contents in the group Box.As for arabic layuout all the contents must be right to left displayed.
Thanks in Advance.
Vipul Khandelwal
Some people dream of success while others wake up and work hard at it
|
|
|
|
|
I am affraid there isn't a single statement to solve this issue but probably as you know you can set the content's text alignment to right or to left one by one as follows:
Label1.textalign = contentalignment.middleleft
Never give up!
|
|
|
|
|
HI,
I am stuck with a problem that how to display an image in the datagridviewimagecolumn
As when i m trying it shows a X mark. Not the Image
My Code is:
Dim ArrowIcon As New Icon("..\Images\Icon1.ico")
Dim IconColumn1 As New DataGridViewImageColumn
Dim IconColumn2 As New DataGridViewImageColumn
IconColumn1.ImageLayout = DataGridViewImageCellLayout.Normal
IconColumn1.Image = ArrowIcon.ToBitmap
IconColumn2.ImageLayout = DataGridViewImageCellLayout.Normal
IconColumn2.Image = ArrowIcon.ToBitmap
Me.DataGridView1.Columns.Insert(0, IconColumn1)
Me.DataGridView1.Columns.Insert(1, IconColumn2)
I don't know why it is not showing the image
Plz help me
Thanks a lot in advance
Hema Chaudhry
|
|
|
|
|
Hello again,
Need help on this code. Im using Flexgrid control the .net version... dont know what to do about this one.. it produce an error stating "Index was outside the bounds of the array...
For intCount = 0 To 10
grid1.Cell(0, intCount).Text = "Hello"
Next
But when i tried it this way.. ( grid1.cell(0,1).text = "Hello" );).. this works... but if i used for next it produces error.. pls help...
your help is highly appreciated.............
tnx in advance..
|
|
|
|
|
First confirm that gird should have 10 rows and start the loop with 1 may be grid index starts from 1.....
For intCount = 1 To 10 'Start with 1 instead of 0<br />
grid1.Cell(0, intCount).Text = "Hello"<br />
Next
Regards
|
|
|
|
|
First, there is no .NET version of the MSFlexGrid. It's just an old ActiveX control that you can still use in your app though.
How many row does your grid have? Your loop says there are 11, number 0 trough 10. If you do have 10 rows, they'll be numbered 0 through 9.
For intCount = 0 To 9
grid1.Cell(0, intCount).Text = "Hello"
Next
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello welbert,
There was a Microsoft FlexGrid for VB 6, but it should still be available in .NET, although it will probably not . Is this what you are using. It was based on an old version of our VSFlexGrid. We, ComponentOne, also have an updated FlexGrid for .NET 1.x and 2.0. I am not sure which one you are using, but each version has the rows indexed from 0, so you are right to start intCount at 0. Keep in mind that 0 to 10 is 11 rows, not 10 rows. If you want to add "Hello" to all rows, it would be better to use
For intCount = 0 to Grid1.Rows.Count -1
Grid1.Cell(0, intCount).Text = "Hello"
Next
This way you know that the index will always be in range, even if rows are added or deleted later. If you still have trouble, please let me know exactly which grid you are using, and which build, then I can provide better assistance.
Suelinda W
Customer Engagement, ComponentOne LLC
|
|
|
|
|
Hello,
Am very new to software development. Please help me out in developing a code which helps in communicating with parallel port thro Visual basic. i found inpout32 dll. But don know how to use it. Kindly do the needful
|
|
|
|
|
You won't get an answer to your question in this forum. Instead, look a bit closer at the Code Project website (and Google) and use their Search functions for help. There are MANY hits for the subject of using a parallel port via VB.
If you have a specific question we are more than happy to assist.
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|
|
|
hi
i am trying to develop outlook add in i.e i want to add two comboboxes in the tool bar. one contains the all the folders name having the contacts. and the second combobox contains all the contacts in the folder we selects in the first combobx.
how to do this
will you help me..
thanks.
Ankit Patial
|
|
|
|
|