|
Hello ahmed!
here is a little snippet I included in my DLL and I run this method in every TextBox the user enters/hovers/focuses whatever.
just change the IL to the appropriate language, in some times (like in am e-mail content TextBox you would use the english one:
<br />
#Region "SetLanguage"<br />
Public Enum e_LanguageStr As Byte<br />
Heb = 1<br />
En = 2<br />
End Enum<br />
''' <summary><br />
''' Sets the keyboard language<br />
''' </summary><br />
''' <param name="Language">a string value to determine which language to set, use "Heb" for Hebrew and "En" for English</param><br />
''' <remarks></remarks><br />
Sub SetLanguage(ByVal Language As e_LanguageStr)<br />
If Language = e_LanguageStr.Heb Then : InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(New CultureInfo("he-IL", True)) <br />
Else : InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(New CultureInfo("en-US", True))<br />
End If<br />
End Sub<br />
#End Region<br />
Shimi
|
|
|
|
|
oops sorry,
include this code in your namespace:
Imports System.Globalization
Shimi
|
|
|
|
|
thank you for this help
Ahmed hassan
|
|
|
|
|
Hi all,
I have a DataGridView for Vendors. And also, I have an update button; the code I put inside to update my Vendors rows is as following:
Me.VendorsTableAdapter.Update(Me.VendorsDataSet)
Me.VendorsDataSet.AcceptChanges()
And I tried the same thing on Details view, and it do not work.
I researched and seems to find that AcceptChanges only work on DataGridView (hope its reliable).
Does anyone know what would be for Details view? (the codes/variable in particular)
I hope the info I gave are not too vague. Any help is greatly appreciated. Thanks!
telly
|
|
|
|
|
Hi,
Please know that AcceptChanges method accepts or commits all the changes that have been made to the Dataset since the last time the method was called or since the Dataset was loaded. AcceptChanges method sets the original value of all fields to the current value. In effect, the new DataSet is the same as the one you would get by reloading it from the database. If your dataset is not excessively large, you can reload it from the database and save yourself some serious debugging.
When you call AcceptChanges on the DataSet, any DataRow objects still in edit-mode successfully end their edits. The RowState property of each DataRow also changes; Added and Modified rows become Unchanged, and Deleted rows are removed. If the DataSet contains ForeignKeyConstraint objects, invoking the AcceptChanges method also causes the AcceptRejectRule to be enforced.
For Code snippet please visit the following link:
http://visualbasic.about.com/library/weekly/aa052403f.htm[^]
I hope this helps.
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Hi,
Thanks for the reply! But I do not really understand what paragraph 2 meant..
"If the DataSet contains ForeignKeyConstraint objects, invoking the AcceptChanges method also causes the AcceptRejectRule to be enforced." -- You mean foreign key in database? But I think my database have a foreign key but AcceptChanges can be used on my DataGridView. (I decided to use that)
telly
|
|
|
|
|
Hello every one. I am defining my problems in detail
I have a vb 2005 Express application
I have been trying to make the payments functionality better
What my intention is to add a new grid and have 4-5 columns
- Serial number
- Date
- Type / Details
- Quantity
- Amount
With all other fields I am able to manage, I am having issues with only one of them
Type/Details
Hear I want to have a combo box which has all the predefined options from DB. On select of any option I want the appropriate price to come
I there is something which is not defined in DB the user should be in a position to type and enter a price also, that is, I want a drop down combo box not a drop down list
User should be in a position to add new rows also
How can I do it..
modified on Thursday, December 27, 2007 6:33:03 AM
|
|
|
|
|
You can use ComboBoxColumn for Type/Detail.
But as for your second part of the question, I am not so sure, you may want check if you can set the ComboBoxColumn dropdownstyle to DropDown, and whether it will set the Text to values that is not in the combo box's items during binding.
Failing so, you may want to use a custom column, instead.
|
|
|
|
|
I suggest you to use the DatagridViewComboboxColumn and DatagridViewTextBoxColumn into a DatagridView.
You should google a little and focus on what you need. For other problem during your development, you will be able to post specific problems and we will help you.
Shay Noy
|
|
|
|
|
I have done something like that with data bound items. You select combobox in Form design view and then click on the sign in the upper right corner of combobox picture. There you select checkbox use bound items and then select apropriate data source, value member and, data member. If you have stored pricess of separate model types in a different table, you will have to make relations between tables to work properly.
|
|
|
|
|
Hi,
I have a datagridviewcomboboxcolumn and I would like to change the selectionbackcolor.
I success in part:
I change the selectionbackcolor to cyan but when I am selecting other item the backcolor of the previous stll cyan
Here is a snippet of my code:
Private Sub EditingControlCombobox_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs)
If e.Index = -1 Then Exit Sub
e.DrawBackground()
Dim brsh As SolidBrush, Fnt As Font
Dim backBrush As SolidBrush
If CType(sender, DataGridViewComboBoxEditingControl).SelectedIndex = e.Index Then
backBrush = New SolidBrush(Color.Cyan)
Else
backBrush = New SolidBrush(Color.Empty)
End If
If e.Index = 0 Then
brsh = New SolidBrush(Color.Purple)
Fnt = New Font("Times New Roman", 10, FontStyle.Italic)
Else
brsh = New SolidBrush(Color.Black)
Fnt = EditingControlCombobox.Font
End If
e.Graphics.FillRectangle(backBrush, e.Bounds)
backBrush.Dispose()
e.Graphics.DrawString(NegotiationItemList.Items(e.Index).ToString, Fnt, brsh, e.Bounds)
brsh.Dispose()
End Sub
Thank you
Shay Noy
|
|
|
|
|
I guessing that you have not put the color changing code in your selectedIndexChanged event. Because you have to select a different index before you can edit, I'd put my code there to change the color back to what you want.
Just because we can; does not mean we should.
|
|
|
|
|
Sorry, I don't understand what you mean.
Shay Noy
|
|
|
|
|
hi all
i have created a stored procedure in sql server with two parameters
todate and from date
i want to generate a crystal report using above procedure
i have no idea about what to write in add command of report for
executing a stored procedure with parameters
if anyone have any idea pls suggest
|
|
|
|
|
Look around on google for examples
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Hi,
I hav a code for import data from excel to sql server. This code used to import data totally. That is, already some data in excel imported the whole data to sql server.The code is,
Dim excelConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Book1.xls;Extended Properties=""Excel 8.0;HDR=YES;"""
Dim connection As OleDbConnection = New OleDbConnection(excelConnectionString)
Try
Dim command As OleDbCommand = New OleDbCommand("Select ID,Data FROM [Sheet1$]", connection)
connection.Open()
Dim dr As OleDbDataReader = command.ExecuteReader
Try
Dim sqlConnectionString As String
'= WebConfigurationManager.ConnectionStrings("CampaignEnterpriseConnectionString").ConnectionString
sqlConnectionString = "Data Source=rafik-vzi7iicz1\sa;Initial Catalog=Excel;Integrated Security=True"
Dim con As SqlConnection
con = New SqlConnection(sqlConnectionString)
Dim bulkCopy As SqlBulkCopy = New SqlBulkCopy(sqlConnectionString)
Try
bulkCopy.DestinationTableName = "Exceldata"
bulkCopy.WriteToServer(dr)
Finally
CType(bulkCopy, IDisposable).Dispose()
End Try
Finally
CType(dr, IDisposable).Dispose()
End Try
Catch ex As Exception
Finally
CType(connection, IDisposable).Dispose()
End Try
MsgBox("imported successfully", MsgBoxStyle.Information)
The code is working perfectly.
My problem is, i need to import the data by character wise. That is, suppose i typing some word in excel, the word automatically saved in sql server by character wise.
Any idea Plz tell me.
Suggestions also appreciate.
Plz help me.
|
|
|
|
|
kamarudeen wrote: i need to import the data by character wise.
What do you mean by "character wise"??
|
|
|
|
|
character wise means cell by cell. That is the data imported to sql server cell by cell.
For ex:
excel sheet:
CELL 1 CELL 2 CELL 3 CELL 4
DATA: VELU RAMU RAMU KATHER
KAMAR SIDDIQ SADIQ SEERR
this is sample data. I need to import data every cell by cell.
|
|
|
|
|
hello
I want to know why this error "Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException'.
now i'm tracing why this error occurr, but can't find yet.
if someone has experience with this error, please help me and send me message.
phoopwint
flowerppk
|
|
|
|
|
AxHost is a class that hosts ActiveX (COM) components on your form. You have a COM-based control that you added to your form that is misbehaving.
|
|
|
|
|
Dear programmers,
Can anyone give me the code to make the data displayed in the datagrid or HFlexGrid editable and then save that in the database.
I urgently need that for my project in the job.
Thanks one and all
Keshav Singh Developer in C++ and VB
|
|
|
|
|
Keshav Singh Sunwar wrote: urgently
Very impolite.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi Paul,
Keshav here to whom you replied a few hours back. I m extremely sorry for the words I used in my message.
Actually I need to do the same at any cost before this weekend, that was the reason 4 the message.
I am trying to make datagrid editable by inserting a textbox on the click event of the Flexgrid for each cell clicked.
I hope it will work out.
Thnx for the message
keshav
Keshav Singh Developer in C++ and VB
|
|
|
|
|
I think Dave's reply is the better one
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
This[^] is about the best information you're going to get on creating an editable MSFlexGrid.
|
|
|
|