|
Okay, tried this, both machines using .net 1.1, the results the same as the head of the thread. Might I have something written wrong, but might it be possible to cut out the call? On a wild goose guess, could it possibly be a control that is the cause of this call (Microsoft.VisualBasic.Compatibility.VB6.DirListBox)?
Code used:
<?xml version ="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v1.1.4322" safemode="true"/>
<requiredRuntime version="v1.1.4322" safemode="true"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity 'name="Microsoft.VisualBasic.Compatibility" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="7.0.3300.0" newVersion="7.0.5000.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
-- modified at 21:12 Tuesday 13th December, 2005
|
|
|
|
|
Yes it could be the result of a rogue control. Remove anything that you don't need and check that the ones you have are .NET compatible.
The App.Config file contents as shown in the Microsoft KB article is the one you should use for .NET Framework 1.1. The one I posted is for 2.0. The differences are the version numbers for the Microsoft.VisualBasic.Compatibility.DLL. Note that the DLL could have been updated by service or a newer version of the framework, so if you have both 1.1 and 2.0 installed the DLL will be a later version.
Check the version numbers on the target machine by searching for that DLL and then checking the Version tab of the Properties dialog for the file. Ensure that the App.Config file specifies the correct ones (n.b. both the one starting "v1.x.xxxx" and "v7.0.cccc" must change.
...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
|
|
|
|
|
It has been done!
I removed the dirlistbox, and used a normal folder browser. I thank you for all the help you have provided, and I now know how to access older controls, which will definitly be a help, as well as a few other things. After I upgrade it a bit I might write an atricle for it, and hopefully others will find it helpful.
|
|
|
|
|
Am using a datagrid for display in VB6. When clicking the row, I want to fill three textboxes with data from the three columns; col1, col2, col3. The problem is that the first click on the datagrid fills the textboxes with the data from row 1. the second click fills the boxes with the data from the previous box. If a double click is used, the correct data is filled into the text boxes.
I am using a sql to open the database and select the fields: sSql = "SELECT fld1, fld2, fld3 from tblmine WHERE fld1 = '" & datagrid1.text * "'". This is in the datagrid's _click sub.
How to have the textboxes filled on the first click?
Thanks,
-- modified at 19:49 Sunday 11th December, 2005
|
|
|
|
|
sSql = "SELECT fld1, fld2, fld3 from tblmine WHERE fld1 = " & datagrid1.text
dim tmpDS as DataSet = 'Execute your query
tbText1.Text = tmpDS.Tables(0).Rows(0).Item("fld1")
tbText1.Text = tmpDS.Tables(0).Rows(0).Item("fld2")
tbText1.Text = tmpDS.Tables(0).Rows(0).Item("fld3")
try something like this. Im prety sure the VB6 structure uses data sets
something like the ones in .Net
Pablo
|
|
|
|
|
Thanks for the response. I am not sure how your example solves the problem of how to fill the databoxes with click instead of double click. Can you explain?
My code so far:
sSql = "SELECT fld1, fld2, fld3 FROM tblMine WHERE fld2 = '" & datagrid1.text & "'"
If rst.State = adStateOpen Then rst.Close
rst.Open sSql, cn, adOpenForwardOnly, adLockReadOnly, adCmdText
txtTrack.Text = rst.Fields("fld1").Value & ""
txtTitle.Text = rst.Fields("fld2").Value & ""
txtLength.Text = rst.Fields("fld3").Value & ""
|
|
|
|
|
The folowing sight has a good example of how to do what you are wanting to do. The begining is a bunch of text, but if you keep going there is some example code. Let me know if you still need help:
http://www.quest-pipelines.com/newsletter-v6/0405_D.htm
Pablo
|
|
|
|
|
Pablo,
Thanks for the response. Unfortunately, the author is not using a datagrid. He is using a listview. The listview works for what I want to do but does not have the look that I am seeking, thus the search for a solution using the datagrid.
Kim
|
|
|
|
|
Hi
I am working with SQL Server 2005 and developing a SSIS package in integration services. I need to add a script task that will zip a file.
Does anyone have any snippets for vb.net that will zip a file.
I will also need to know if I require any additional dlls etc to make the code work.
cheers
|
|
|
|
|
I'm pretty new at programming, and could sure use some help. I am trying to pull the first letter from a textbox string. I have looked through all of my reference material and old code but can't seem to find it. Please help, thanks.
culbysl
|
|
|
|
|
I think you need txtSomeTextBox.Text.Substring(0, 1) .
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
Char firstchar = yourtextbox.Text.Chars(0)
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter
Clear VB: Cleans up outdated VB.NET code
|
|
|
|
|
Sorry - mixing up my languages there.
Should be:
Dim firstchar As Char = yourtextbox.Text.Chars(0)
or simply (in 2005 only):
Dim firstchar As Char = yourtextbox.Text(0)
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter
Clear VB: Cleans up outdated VB.NET code
|
|
|
|
|
Thanks Marc and David for your help. I'm off and running on this end now.
culbysl
|
|
|
|
|
i wrote a simple program to create a text file and read it to test with, another program i made works when it resides on a local machine. i would like for it to be able to sit on a network drive so my co-workers can use it also, but the problem is that it throws a security exception when it's ran from a networked drive so i developed this to test and hopefully figure out how file permissions work. If anyone could help that would be great.
here is the code. where do i start?
Imports System.IO
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim oFile As File
Dim oWrite As StreamWriter
Dim oRead As StreamReader
oWrite = File.CreateText("test.txt")
oWrite.WriteLine("test test test")
oWrite.Close()
oRead = File.OpenText("test.txt")
TextBox1.Text = oRead.ReadToEnd
oRead.Close()
End Sub
End Class
|
|
|
|
|
I highly suggest reading up on Code Access Security[^]. What you seek can be found in there.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
well i read through it and it did help thank you, but now i've got a new problem, so maybe i didn't catch everything in that reading. but heres the new code and the new error that is compile time error
code:
Imports System.IO
Imports System.Security.Permissions
Imports System.Runtime.InteropServices
<assembly: permissionset(securityaction.requestminimum,="" name:="Full Trust" )="">
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim oFile As File
Dim oWrite As StreamWriter
Dim oRead As StreamReader
oWrite = File.CreateText("test.txt")
oWrite.WriteLine("test test test")
oWrite.Close()
oRead = File.OpenText("test.txt")
TextBox1.Text = oRead.ReadToEnd
oRead.Close()
End Sub
End Class
error:
Unable to emit assembly: Unexpected exception processing attribute -- System.ArgumentException: Unable to generate permission set; input XML may be malformed..
all this stuff is new to me.
|
|
|
|
|
Hello every body.
I have a problem with the image adding on an MDI container in vb.net. Image looks fit. But when a child form is opened it hides behind the image box control. Can any body suggest me about the problem. And how to solve it.
I shall be grateful to you......
FIRE
|
|
|
|
|
Yeah, that's been coverd dozens of times in the forums. ANy control you put on the MDI parent will show ABOVE any MDI Child forms. This is because there is a hidden control in the MDI Parent that actually serves as a container for the child forms. Any control you put on the MDI Parent form will be over the top of this hidden control.
You can read more about the MDIClient contorl, here[^].
If you closely enough at that documentation, you'll find it even has it's own BackgroundImage property. All you have to do is interate through the controls on your form and find the only instance of an MDIClient control, cast a variable to it, then set its BackgroundImage property.
If Me.Controls.Count Then
For Each control As Control In Me.Controls
If TypeOf control Is MdiClient Then
Dim mdiClientArea As MdiClient = CType(control, MdiClient)
mdiClientArea.BackgroundImage = New Bitmap("filepath")
Exit For
End If
Next
End If
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Writing my own update statements for a fairly complex datagrid. When running my insert/update/del statements I get "parameter ?_5 has no default value." in the error icon on the left next to each modifed record, and no updates are performed.
Trying to understand what field ?_5 is in the whole scheme of things. Field in dataset, field in SQL statement, what.. and how to make the error become more understandable...like change it to display the field name?
thanks for any help or ideas..
|
|
|
|
|
i have this problem thats got me firing ...
i have an array that holds files locations (one,two or more files),
i need to get these files and merge them into one file in VB.NET can someone help me ... its killing me!
elms
|
|
|
|
|
What's the problem you're having?
This is a straightforward problem. You open/create the target file, then open each file, one at a time, from the array. Read the file, line-by-line, and write each line to the target file. Close the source file, then get the next filename and open it. Read it, line-by-line, ... When you get through the list, close the target file and you're done.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I tried to get the short date format from the regional and language control using the API function GetLocalInfo. whatever is my culture, I want the short date saved in control panel. I execute the API function without any problem in VB6 and I get the same format saved in control panel.
but in VB2005, when I call the API function it return an error:
A call to PInvoke function 'Schools!Schools.My.MyApplication::GetLocaleInfo' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
can anybody help me please.............
OmarMallat
|
|
|
|
|
You got the parameters in the Declare statement for GetLocaleInfo wrong. For example, a Long in VB6 is equivilent to an Integer in VB.NET, not a Long. This is probably where most people go wrong when converting their code.
But, since all the Locale API's in Win32 are wrapped in the .NET Framework Base Class Library, why are you even calling this?
Dim df As DateTimeFormatInfo = Thread.CurrentThread.CurrentCulture.DateTimeFormat
More on the DateTimeFormatInfo can be found here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Dave but this solution give me the format based on the culture of my application and not the culture in regional settings.
so my application run with a culture "fr-FA" and your command give me "dd/MM/yyyy" although the regional setting have the culture "en-US" so the format is "M/d/yyyy".
I found a solution, but it is not perfect:
before I set the culture of my application to "fr-FA" or "ar-LB", I catch this variable so I find it same as the regional setting because when the application start loading it have the same culture as the regional setting. and I put this result in a public variable.
but let we say that while my application is running, the user go to the regional setting and change the format manually, so my variable still having the old format, and several problems may occur...
thanks anyway... but still waiting
OmarMallat
|
|
|
|