|
I have called upon the coding to load combo in excel sheet from vb
Set xlRange = xlSheet.Range("D" & CStr(intCurrencyCol), "G" & CStr(intCurrencyCol))
xlRange.Cells.Merge
xlRange.Font.Bold = True
xlSheet.OLEObjects.Add "Forms.ComboBox.1", Left:=lngLeft, _
Top:=lngTop, Width:=lngWidth, Height:=lngHeight
xlSheet.OLEObjects("ComboBox1").object.Name = "CURRENCYCOMBO"
xlSheet.OLEObjects("CURRENCYCOMBO").object.Font.Name = "Arial"
xlSheet.OLEObjects("CURRENCYCOMBO").object.Font.Size = 8
xlSheet.OLEObjects("CURRENCYCOMBO").object.Style = 2
with some range of value in combo box as
X = 0
For Each CCName In CurrencyNames
X = X + 1
xlSheet.Cells(X, 16) = Trim(CStr(CCName))
Next
If X > 0 Then
Set xlRange = xlSheet.Range("P1", "P" & CStr(X))
xlSheet.OLEObjects("CURRENCYCOMBO").object.ListFillRange = xlRange.Address
End If
all work fine now when the user change the item in combo its should be list out in another cell
how to handle event in excel through vb
|
|
|
|
|
Nice, vote me a 1 after I just get done telling you that I'm no expert in Excel programming...
But, since you added the combobox in code, not using the designer, it looks like you have to wire up the events yourself. You've just got even further away from my experience in Excel. This list[^] is about the best I can do for you.
|
|
|
|
|
hi
i have this commend to update but it did not work can any body Expected way it did not work
Dim Slots5Sec As New DataSet<br />
Dim DataAdapter6 As New OleDb.OleDbDataAdapter(SqlSlots4Sec, con)<br />
Dim CmdB1 As New OleDb.OleDbCommandBuilder(DataAdapter6)<br />
<br />
DataAdapter6.Fill(Slots5Sec, "Slot") ' fill the data set<br />
<br />
DataAdapter6.Update(Slots5Sec, "Slot")
i change in some value and i want to save it in db ?
|
|
|
|
|
That code you posted is incomplete, so you may not get an accurate answer...
asha_s wrote: DataAdapter6.Fill(Slots5Sec, "Slot") ' fill the data set
DataAdapter6.Update(Slots5Sec, "Slot")
But, you didn't make any changes to the dataset between the Fill statement (which, I'm assuming, retrieved a bunch of records from the database) and the Update statement (which writes changes back to the database.)
UPDATE:
I notice your messages down the forum. If you're trying to use an SQL statement that retrieves data from multiple tables, like using a JOIN, the SqlCommandBuilder will not generate UPDATE, DELETE, and INSERT commands for the DataAdapter. The DataAdapters only work with single table queries when performing updates. SELECT queries on multiple tables work just fine though.
|
|
|
|
|
thanks
i found the error
|
|
|
|
|
I want to customize the user interface by changing the look and feel of the installation windows (Example change font, Back color add pictures etc...) Is it possible in Visual Studio.NET 2005.
If so please provide and helpful resources...
Thank you...
Jats
|
|
|
|
|
Using the Setup project in Visual Studio, there's no way to change this stuff. You'll have to use a third party product to do this.
|
|
|
|
|
Dear,
I currenly using VB.NET with TreeView Control, I want when the From is loaded, the Treeview control will select item whatver I want, so how can i do?
TreeView1.SelectedItem =4 (It not work )
Socheat
|
|
|
|
|
The selected item will be a treeviewitem, not a number.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Assuming the 4 is used as the key for the treeview, you need to recursively check each node. Something like
Treeview check each top node
For each oNode in Treeview1.nodes
Test key/tag/column for 4
If the node has children test the children
loop
There is a reason treeviews do not have huge amounts of data
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello all, I'm looking for a code which can help me to connect VB.NET(Window Form Application) with MySQL database. I have successfully connect it by putting the code below on my application.
Dim ConnString As String = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=testhelp;UID=root;PASSWORD=;Option=3;Port=3399;"<br />
Dim Objconn As New OdbcConnection(ConnString)<br />
Dim ObjComm As New OdbcCommand<br />
Dim ObjAdapter As New OdbcDataAdapter<br />
Dim ObjRead As OdbcDataReader
But,I need to run this application with multi user mode or it might be store inside a server for the data. Anyone could show me how to create a connection string and solution for me? How can I put this to a Module or class to share the connection string inside my application?
Hope someone could help me on this. Thank you for reading.
|
|
|
|
|
At first you should add connection string to project settings:
Projct->Properties->Settings
There you should fill 4 colums:1."Name"(name of connection string) 2."Type"(you should select "Connection String" 3.Scope ("Application") and last 4."Value" (You should write connection string like this: Server=localhost;Database=;Uid=root;Pwd=; )
Then you sholud declare this connection string in your project.
For example:
<br />
Dim mMySQLConnectionString1 As String = My.Settings.MySQLConnectionString '"MySQLConnectionString" this is a name of connection string<br />
<br />
Public Overloads Sub DataLoading(ByRef pDataGridViewControl As DataGridView, ByRef pRecordCountInt32 As Int32, ByRef pErrorMessageString As String)<br />
<br />
Try<br />
Using mMySqlConnection As New MySqlConnection(mMySQLConnectionString1)<br />
mMySqlConnection.Open()<br />
Using mMySqlCommand As New MySqlCommand<br />
With mMySqlCommand<br />
.Connection = mMySqlConnection<br />
.CommandType = CommandType.Text<br />
.CommandText = "SELECT FROM `table`"<br />
<br />
End With<br />
End Using<br />
End Using<br />
Catch exError As Exception<br />
pErrorMessageString = exError.Message<br />
End Try<br />
End Sub<br />
By this fragment of code other users can connect to your DB.
|
|
|
|
|
Yeah,thank you friend.I got the concept from your code now. But how could I make this as a global connection string in my window form application? What do you mean by project>Properties>Setting? I can't really find whats that inside for me to fillup the 4columns. I'm using Visual Studio.NET 2003 connect to MySQL database.
Should I open a module and put this code inside? Can this code also apply for using a Dataset for my datagrid?
|
|
|
|
|
Hello every
I am having a VB.net 2005 application
It was running all file but after i clean and rebuild it i am getting the above error while running it
The type initializer for 'Application.DatabaseInit' threw an exception
where DatabaseInit is a module
I also did a diff with old working version... the only difference i was able to find was in suo file...
Dose any one have any idea why am i getting this error and how to solve it
Regards
Nishkarsh
|
|
|
|
|
This may be caused by the connection to SQL failing authentication. Step through the code and check your connection string.
Obscure I know but the hint is your DAL is failing and it probably has inadequate error trapping so you get the default message which is really informative (not).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi Toall ,
I want to explain you clearly ,
I am having some panels having some controls
CheckBox,ComboBox,Datagridview,Hyperlink,label,Listbox,Picturebox,RadioButt
on ,Textbox)
&(Oval,Line,Rectangle ). with .BorderStyle =
BorderStyle.FixedSingle . All these things are generating at runtime
using some buttons .
I am taking them in to bitmaps and then printing using ACROBAT
DISTILLER printer.
I am printing each Bitmap on a new page taking e.MarginBounds of
PrintPage event using e.Graphics.DrawImage () .
I took each control on a single panel. Then i take the
panel
into bitmap using control.drawtobitmap() .And then I print the
things .
Suppose if the panel is having Circle or line or ComboBox or Checkbox
or DataGridView or URL or ListBox or RadioButton ,it is showing the
borders .
Suppose if it is having picturebox or rectangle or Textbox missing
the
borders . or if the panel is not having controls then it is missing
the borders while printing .
It is showing the borders in printpreview everytime(I have to zoom
to look at these things ) but while printing ,sometimes, it is
printing with borders ,sometimes it is missing the borders.
If it is the last page to print it is missing last
3-4 lines (Missing the image part at bottom ). Suppose, i am having
2
bitmaps having the samesize and controls ,then in 1st page it is
printing with controls & borders exactly correct .But while coming to
last page, it is missing bottom 3-4 lines which makes the printing
incorrect .
So any help about this to make the printing correct exactly.
Thanks & Regards ,
|
|
|
|
|
hi guys
i am working in vb.net 2005 its a 3-tier application, i have a windows form which contais some textboxes and comboboxes based on the values of these controlls i am creating my query to get data from data base ,
eg.
where value 1 = txt1 and value 2 = txt2 and val3 - txt3 ..
but i cant generate this where clause at run time coz all the parameters in the above query are
optional if user doest not enter any value i have to get all the data
can u please tell me the right approach to do that.
Thanks in advance
............
hello
|
|
|
|
|
First of all, you should use a stored proc. Second 'value 1' is not valid, it has a space in it.
I'd do it like this
where (value1 = @val1 or @val1 = '') and (value2 = @val2 or @val2 = '')
So that passing in blank parameters, causes them to be ignored.
This should have been askjed in the SQL forum.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello everyone
I Add this tool "Microsoft ADO Data Control 6.0"
<br />
dim dnsip As String<br />
<br />
ado.RecordSource = "select ip1,ip2,ip3,ip4 from DNSTable where hostname like ('dnshostname ') "<br />
<br />
dim dnsip as String
dnsip = ado.RecordSource = "select ip1,ip2,ip3,ip4 from DNSTable where hostname like ('dnshostname ') "
How i can store or save the retrieve select statment in variable like dnsip
Thank you
-*-*-*-*-*-*-*-*-*
To Be Or Not To Be
(KARFER)
-*-*-*-*-*-*-*-*-*
|
|
|
|
|
git
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
eloquent
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I answered this yesterday, and you didn't reply, but now you ask it again ?
Are you using VB6 ? If so, why would you do such a thing ? If not, why use ADO ?
Dunno why I bother trying to help, it seems anything beyond a cut/past solution, you will ignore and just ask again.....
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi
how can i define dynamic array and how can i know its size
please help
|
|
|
|
|
A dynamic array is on in which you don't know the size when you start, so the question is a bit unclear. However, defining and using a dynamic array is about as easy as using a regular arry.
I'll give example in a single-dimension array
<br />
Private fileList() As sDownloadRecord<br />
<br />
Private Sub clientTimer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles clientTimer.Tick<br />
' keep track of overall files to download count<br />
Dim queuePosition As Integer = 0<br />
ReDim fileList(queuePosition)<br />
<br />
For i As Integer = 0 To UBound(Severe)<br />
fileList(i).URI = "[uri obscured]" & My.Settings.Calls.ToLower & "/" & Severe(i).InFile<br />
queuePosition += 1<br />
ReDim Preserve fileList(queuePosition)<br />
Next<br />
End If<br />
Note: sDownloadRecord is a structure of string items. It's not important to this example. The important thing for answering your question lies in these lines:
<br />
Private fileList() As sDownloadRecord<br />
This sets up the dynamic array...initializing it without a size.
<br />
Dim queuePosition As Integer = 0<br />
This sets the array to size 0 (1 item, since arrays are 0-based).
<br />
ReDim Preserve fileList(queuePosition)<br />
After you put a value in the array, you need to expand the array to accept the next value. "ReDim Preserve" handles this.
"UBound" is how you know where the top of the array is. You see it used in the line
<br />
For i As Integer = 0 To UBound(Severe)<br />
As Severe() is a Dynamic array of strings, too.
Hope that helps!
Scott
|
|
|
|
|
thanks
do you think that using ( ArrayList ) is butter than dynamic array
|
|
|
|