|
How do I merge these 2 functions into 1 or better yet have one function that does the clear and add methods for all bindable controls.
This function will not be called in the formLoad because it will be called repeatedly by a button click. (thus the clear method must be called)
Also, I have OPTION STRICT turn on so the first parameter cannot be a system.object. (unless you can think of way to get by it)
Private Sub BindTextBox(ByRef txtBox As TextBox, ByVal sProperty As String, ByVal obj As Object, ByVal sObjectProperty As String)
txtBox.DataBindings.Clear()
txtBox.DataBindings.Add(sProperty, obj, sObjectProperty)
End Sub
Private Sub BindLabel(ByRef lbl As Label, ByVal sProperty As String, ByVal obj As Object, ByVal sObjectProperty As String)
lbl.DataBindings.Clear()
lbl.DataBindings.Add(sProperty, obj, sObjectProperty)
End Sub
|
|
|
|
|
Just make the functions have the same name(overload) when you call BindMe the program will determine the correct function to use based on either textbox or label
Private Sub BindMe(ByRef txtBox As TextBox, ByVal sProperty As String, ByVal obj As Object, ByVal sObjectProperty As String)
txtBox.DataBindings.Clear()
txtBox.DataBindings.Add(sProperty, obj, sObjectProperty)
End Sub
Private Sub BindMe(ByRef lbl As Label, ByVal sProperty As String, ByVal obj As Object, ByVal sObjectProperty As String)
lbl.DataBindings.Clear()
lbl.DataBindings.Add(sProperty, obj, sObjectProperty)
End Sub
|
|
|
|
|
Can someone please help fix this function below? I have option strict turned on so it requires a lot of explicit conversions. I am passing data from datatables back to a business object.
for instance I have to use CTYPE a lot to convert to an explicit datatype but the DBNulls are killing me!!!!
busObj.field1 = ctype(dtrow("field1"), string)
'Private Function CTypes(ByVal obj As Object, ByVal Type As Type) As Object
' If Not (obj Is DBNull.Value) Then
' Return CType(obj, Type)
' Else
' If Type.Name = "String" Then
' Return String.Empty
' ElseIf Type.Name = "Integer" Then
' Return 0
' ElseIf Type.Name = "Date" Then
' Return "01/01/1900" 'or some other value
' End If
' End If
'End Function
|
|
|
|
|
I am creating an application which will create folders and will place web pages on the web server.
Now that's easy and it's done. Now the difficult part
The application has also to configure IIS and i've not been able to configure IIS for the website through vb.net. Is it possiable to configure IIS through vb.net and
Is there any way that i can protect the ASP code from being viewed.
|
|
|
|
|
I am having difficulty reading the images. I want the images to be embedded so that the are built into the .dll of the control. Every time i try and use my control i get 'null is not a valid value for stream.' i have verified the names of my control, image , .dll name. i have also tried diferent variations to get the image. Please help.
|
|
|
|
|
I think I have it. I had a similar problem in a C# project, the IDE kept changing the line that creates the ResourceManager, and I had to change it to something like this or I got the same error:
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(MyControlType))
I believe if you create your ResourceManage with this line and then use it to load your Bitmap, there's a good chance it will work.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have created my own DLLs in VB.NET. However, this DLL has a couple of dependent DLLs. Is it possible to combine all the dependednt DLL along with my user control to create only one combined DLL?
Thanks
|
|
|
|
|
Yep - if you have the code to all the dlls, there's no reason why you can't merge them. If you don't, then I doubt it, at least not simply.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Nope I do have the code to them. I am using some DLL from other SDKs and my own code. I would like to combine those DLLs with mine since it is easier to move around 1 DLL rather than a bunch of them when I want to use my created user control elsewhere.
Thanks
|
|
|
|
|
In that case, remove all references to external dlls and copy the source files in from the external dlls until you have everything you need.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
There is a tool from Microsoft Research called IlMerge which probably does what you try to achieve. There is even an article about it here on CodeProject.
|
|
|
|
|
This looks good. I will play around with it and hopefully get it to work. If I have any problems I will post. Thanks for your help.
|
|
|
|
|
It works, that is awesome. Thanks for all your help.
|
|
|
|
|
Anyone know how to convert from string to time?
I have a dropdown list that contain a list of time. When I retrieve the value selected by user, but the problem is the value return from the dropdown list is in text/string. How can I convert it to time?
Thank you very very much in advance for reply my question.
|
|
|
|
|
Depends on the format but you could try: Convert.ToDateTime(myString)
|
|
|
|
|
dim now as datetime = datetime.now
dim temp as string
temp = now.tostring
Stephen May
|
|
|
|
|
So what are you trying to tell me with this?
The question was how to convert string to time and not time to string like you did.
|
|
|
|
|
sorry, long day
Use the old standby cdate(string)=datetime
or use dateserial(year,month,day)
If you only want the time portion then
format(cdate(string),formatstring)
|
|
|
|
|
why don't you use Time.Parse(MyString) ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
hi,
i'm creating an web application in vb.net which has 3 level drop down menus. if you are not getting what im saying then please visit this website.
http://www.gehealthcare.com/inen/
in this website on the lefthand side there a lot of items like diagonostic imaging, cardiology, information technologies, education etc. click on any of the items and you get further list of items. i just want this effect in my web application, which i'm developing in vb.net.
how do i do this. anybody got ideas help me.
|
|
|
|
|
You can start with posting this in the ASP.NET Forum. Then move on to a JavaScript forum because that's what it's going to take to get this to work. ASP.NET is a server-side only technology that generates HTML for browsers. It does nothing client-side.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Are there any articles on CP that cover this ( that is, the seperation between client and server in ASP.NET ) ? There seem to be a lot of questions of late where people have no idea how/where it all works.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I haven't seen any, but I've just picked this stuff up out of the docs.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am a newbie to vb.net. I have done some things in VB for applications but not vb.net.
What is the best way to show info from a database in a grid style format that can update/refresh every 5 to 10 minutes. There will be no user interaction. I can get the info from an SQL database but the output is what I need to figure out. I played with datagrids but that seems like overkill. I also need to format the output of the data based on specfic criteria.
If there is an example to look at I would like that also. If this program can be done through asp.net more efficiently then I will go down that road also.
Any help would be appreciated.
Thanks for all the help
NewbieDave
|
|
|
|
|
NewbieDave wrote:
What is the best way to show info from a database in a grid style format that can update/refresh every 5 to 10 minutes.
A datagrid and a timer.
NewbieDave wrote:
I played with datagrids but that seems like overkill.
OK, then use a ListView. They are harder to set up tho.
NewbieDave wrote:
If this program can be done through asp.net more efficiently then I will go down that road also.
Use ASP.NET only if you need online connectivity, otherwise it's just too limiting compared to what you can do with WinForms.
NewbieDave wrote:
I also need to format the output of the data based on specfic criteria.
You should really use a DataGrid. You can specify a number of views on a datagrid, and the views will automatically be used based on table name, then rename your table to reflect the view required.
Christian Graus - Microsoft MVP - C++
|
|
|
|