|
Well its Difficult to say, especially if we dont see the code. but i think you have tempered with the return type when you were doing modification this morning. Lets see how you wrote your function that return that datatable and we can point where the Problem is.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hello again,
Next description is more aproximated about problem is:
I created a Web Service using .Net 2.0 that has a function that
returns a DataTable. I can test the function from the web page when I access
the .asmx from a browser on localhost and it works.
The problem I have now is when using VS 2005 or VB.Net 2005 Express and creating a web references is
that the proxy created doesn't map the function as returning a DataTable
instead returns some other type of object named xxxxResult where xxxx is the
name of the web service function.
I have another function that returns a DataSet that works perfectly with the web reference although I'd rather use a DataTable since I won't need all the functionality that a DataSet brings.
Anyone have the same problem and found a solution?
|
|
|
|
|
Still until you show us the code, we will not know what is the problem, try to post your code
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Using DataSet and not DataTable as method argument and/or return type, the client application recognizes de types, and so it works.
I've looking other forums, and other people has the same problem.
Solution has not been found, but everybody is using DataSet vs. DataTable.
Microsoft exposes this article, recommendating using DataSets:
http://support.microsoft.com/kb/306134
|
|
|
|
|
Its True , you have to return a dataset.but you must filter it, dont return everything, because you might return a large sum of data that might not be needed by your application and consume a lot of resources
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I build a minimal dataset:
Dim Ds as new DataSet
Ds.Tables.Add(MyTable)
return(Ds)
Thanks for your patient.
|
|
|
|
|
Thats Fine,
what you did is good.
Rememmber Patience is better than Pride, am glad you got your solution rate my post
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi,
In my application i have to open a new window and then to do some calculation and then to show that value on parent window.
thanks in advance
|
|
|
|
|
Hello,
You can try the given solution.
Lets say we have two forms Form1 and Form2.
In form2 we define a function which takes the Form1 as argument.
Form1 _frm;
Public Sub ShowForm(ByVal frm As Form1, ByVal img As Image)<br />
<br />
_frm = frm<br />
Me.Show()<br />
<br />
End Sub
Lets say we will return a value of type integer to Form1. For that we will have to define an integer
variable in Form1 and a Property for that variable to set its value.
Dim _val As Integer<br />
<br />
Property Val() As Integer<br />
Get<br />
Return _val<br />
End Get<br />
Set(ByVal value As Integer)<br />
<br />
_val = value<br />
End Set<br />
End Property
On Button Click in Form 1 we will open the Form2 in the following manner:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
<br />
Dim frm As New Form2<br />
frm.ShowForm(Me)<br />
<br />
End Sub
Now in FormClosing of Form2, we will set the value.
Private Sub Form2_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing<br />
<br />
_frm.Val = 2<br />
<br />
<br />
End Sub
I hope this helps.
Regards,
Allen
Allen Smith
ComponentOne LLC
www.componentone.com
|
|
|
|
|
As part of an Order System, I am wanting to email to the supplier the order,(held as two sheets), in PDF format.
'Email The Order
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
"C:\DOCUME~1\David\LOCALS~1\Temp\" & strFileName & ".pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Application.Dialogs(xlDialogSendMail).Show
'Get Back to Front Page
As far as I can tell, this ought to do the job, but it still emails the thing as a .xlsm
Am I missing the plot?
The main workbook has many pages, I merely save the two pages of the order as a seperate .xlsm file and whilst still active, email as a .pdf file.
Major Puzzlement ensues!
Any Suggestions?
------------------------------------
"I want you to imagine I have a blaster in my hand" - Zaphod Beeblebrox.
"You DO have a blaster in your hand" - Freighter Pilot
"Yeah, so you don't have to tax your imagination too hard" - Zaphod Beeblebrox
|
|
|
|
|
How to autostart up my vb application inside the system registry without "The specified RegistryKeyPermissionCheck value is invalid"
i have created and experimenting a vb2005 win application which i need to auto start up when windows run.. so programmatically i have a code communicating in the system registry?? i can read from HK_LocalMachine SubKey's and KeyName and KeyValue's but then when my application attempt to create/write a KeyName with it's corresponding KeyValue?? this give an error like this:
The specified RegistryKeyPermissionCheck value is invalid
Parameter name: mode
microsoft.win32.registrykey.validatekeymode(registrykeypermissioncheckmode)
'********** here's my experiment vb code reading and creating KeyName/KeyValue in the windows start up... i've just learned this from other post...
'******************
<br />
<br />
Imports System.IO<br />
Imports Microsoft.Win32<br />
Imports System.Security.Permissions<br />
<br />
Public Class MySampleApplication<br />
Private Sub CreateKey()<br />
Dim regKey As RegistryKey<br />
Dim KeyName As String = "MySampleApplication"<br />
Dim KeyValue As String = "C:\MySampleApplicationFolder"<br />
<br />
regKey = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True, Security.AccessControl.RegistryRights.SetValue)<br />
<br />
If regKey.GetValue(KeyName) = Nothing Then<br />
'if there's no KeyName yet? then create and set it's value<br />
MsgBox("No value found")<br />
regKey.SetValue(KeyName, KeyValue, RegistryValueKind.String)<br />
MsgBox("key " & KeyName & " has been created")<br />
Else<br />
'if KeyName is already existing? then verified it KeyValue<br />
MsgBox("Value Found")<br />
If regKey.GetValue(KeyName) = KeyValue Then<br />
'if KeyName is already existing and KeyValue is the same? DO NOTHING<br />
MsgBox("value equal")<br />
Else<br />
'if KeyName is already existing but the KeyValue is diff from the original? then remodified to it's original path..<br />
MsgBox("value not equal")<br />
regKey.SetValue(KeyName, KeyValue, RegistryValueKind.String)<br />
MsgBox("key " & KeyName & " value has been remodified and back to its original application path")<br />
End If<br />
End If<br />
Catch ex As Exception<br />
MsgBox(ex.ToString)<br />
End Try<br />
End Sub<br />
End Class<br />
'****************************
Please anybody there who have any good idea with this??? im just newbie in registry manipulation using VB2005.. please forgive me from being ignorant.. im just trying to level up my programming skills...
Please any body help please??.... it's urgent.. i need this in my programming project case study...
modified on Monday, July 21, 2008 4:54 AM
|
|
|
|
|
Leave off the Security.AccessControl.RegistryRights.SetValue in the regKey = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True, Security.AccessControl.RegistryRights.SetValue) line.
Please don't say it's urgent. It's a given because everyone thinks their question is urgent.
|
|
|
|
|
I have a question about your code. I inserted it into a project of mine (using Visual Studio 2008) and it refused to compile "until there was an 'Opening Try' statement." I've scanned your code and in fact don't find a *Try* statement. Where, in your code, did you or do you plan to place the *Try* statement?
David
|
|
|
|
|
'****i used to be put it like this example...***
'***************
<br />
Private Sub mySubFunctionName()<br />
try<br />
<br />
'****youre code statement goes here*****<br />
<br />
Catch ex As Exception<br />
MsgBox(ex.ToString)<br />
End Try<br />
End Sub<br />
|
|
|
|
|
Excuse me "The JZ" thanks for the reply.. i really appreciate your effort.. but i've try it before, before i've post this thread..
NOTE!!!!!!!! i forgot to say that this code work good in Windows 2000!! but does not work on "XP Pro SP3" or higher like "Vista".. and i want it to work with this OS platform... you can try my code and let me know if it will work on XP Pro SP2
anybody there got a good possible solution??
<br />
regKey = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)<br />
but this still gives me a security exception error like this...
System.UnauthorizedAccessExeption: Attempted to perform an unauthorized operation.
at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind value kind)
but just like i've said before from the very first of my thread? my code can only read but can't write on the registry... how am i suppose to write in the registry using Microsoft.Win32??? without having security exception error... my user account is already an administrator and i already set my application as a full trust application in PROJECT PROPERTIES/SECURITY/ENABLE CLICKONCE SECURITY SETTINGS as FULL TRUST APPLICATION of my WINDOW PROJECT IDE VS2005....
'*********** please review my code********
'***********this is my real actual code a little differ in my fisrt code which i just simplified before****
<br />
Imports System.IO<br />
Imports Microsoft.Win32<br />
Public Class myApplicationName<br />
Private Sub CreateAutoRegistryKey()<br />
Try<br />
Dim regKey As RegistryKey<br />
<br />
'NOte: appKeyName will be look like this "myApplicationName.exe"<br />
Dim appKeyName As String = FileIO.FileSystem.GetName(Application.ExecutablePath)<br />
<br />
'Note: then appKeyName will now look like this "myApplicationName"<br />
appKeyName = appKeyName.Remove(appKeyName.IndexOf("."), 4)<br />
<br />
regKey = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)<br />
<br />
If regKey.GetValue(appKeyName) = Nothing Then<br />
MsgBox("No value found")<br />
regKey.SetValue(appKeyName, Application.ExecutablePath, RegistryValueKind.String)<br />
MsgBox("key " & appKeyName & " has been created")<br />
Else<br />
MsgBox("Value Found")<br />
If regKey.GetValue(appKeyName) = Application.ExecutablePath Then<br />
MsgBox("value equal")<br />
Else<br />
MsgBox("value not equal")<br />
regKey.SetValue(appKeyName, Application.ExecutablePath, RegistryValueKind.String)<br />
MsgBox("key " & appKeyName & " value has been remodified")<br />
End If<br />
End If<br />
Catch ex As Exception<br />
MsgBox(ex.ToString)<br />
End Try<br />
End Sub<br />
End Class<br />
Please anybody help... please??...
modified on Monday, July 21, 2008 9:07 PM
|
|
|
|
|
Hmmm. Does your user account have permissions to write to HKEY_LOCAL_MACHINE?
|
|
|
|
|
Yes! my user account is an administrators account... that's why im pretty confuse... why this can't work well..
and there's another... i forgot to say that my code, work well in Windows 2000!! but does not work on "XP Pro SP3" or higher like "Vista".. and i want it to work with this OS platform... you can try my code and let me know if it will work on XP Pro SP2 because i dont have XP Pro SP2 anymore...
anybody there got a good possible solution make this work on the other OS platform?? i've already expected that my code will not work on Vista cause of its very high security features... but i wonder how to make it work in XP SP2 or neither XP SP3 which is my point of platform to run my application..
and also...
Thanks to "The JZ" for giving attention in this thread.. i really appreciate a lot..
and im really glad if any body there will share their good idea... please???
|
|
|
|
|
Oppzzzz!!! Sorry to bother... im confuse... my user account is one of administrators account type and has no restriction.... i wonder why my application code does'nt work well until??? until i use the computer fixed/real administrator account when the OS first installed... which means??? all other administrators acount type.. dosn't really a fully administrator account???
Hey... "The JZ" thanks for the great help!!! youre a lot of help.. thanks again...
|
|
|
|
|
Hi all,
I am looking forward to develop a Proxy Mail server, for our office mail distribution.
In Detail: All the mail of our company(Branch office) employees go to our main mail server hosted at www.website.com
To access our mail from the branch office we need to use a proxy mail server(placed in our branch server) which can fetch mails from the main server and distribute them to the individuals.
As i said i need to develop the same, and googled but i did not get any inputs.
Can any body please help me, and provide some information from where i can get started.
Previously i wrote a piece of code through i am able to send mails over, but not able to fetch them. please help...
I will be thankful for any kind of information...
Jats
|
|
|
|
|
I would like to get Visual Basic 6.0 source code for displaying video / frame capture using a higher resolution Web camera (more than 640 x 480)
Currently i have a code for displaying video / frame capture, but only upto 640 X 480 resolution.
I want to display video / capture frames upto 1600 X 1200 resolution.
I am willing to pay for the source code. Could anyone direct me to a web site that can solve my problem?
|
|
|
|
|
Clement Victor wrote: I am willing to pay for the source code. Could anyone direct me to a web site that can solve my problem?
Sounds like you want to post a job on the new CP job site, and see if you can find someone you can pay to develop this for you.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Have a look at ComponentSource. Chances are you will find a commercial control for your requirements and sometimes even with source code.
640x480 resolution is MPEG2 standard resolution so I am guessing you want HD quality.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
We had a ASP.NET 1.1 Windows app that had the code below that I'm now trying to implement in ASP.NET 2.0 Windows app. The problem is that Main is "not found". The idea behind this is that it checks to see if the server has a new version and, if it does, it downloads it to the client computer and updates it. Can't figure out what I'm doing wrong... I get the error at the first Try / Catch at typeContent.InvokeMember. The error message is "Method 'Example.My.MyApplication.Main' not found."
The code is based off of the posting found at http://www.codeproject.com/KB/dotnet/DotNetBuildSmClnts.aspx[^]
Thanks,
Dan
Imports System.Reflection
Imports System.Security
Imports System.Security.Policy
Public Class Utility
Friend Shared Sub CheckForNewVersion()
Dim assemblyContent As System.Reflection.Assembly = Nothing
Dim strURL As String = "http://www.example.com/example/example.exe"
Try
assemblyContent = System.Reflection.Assembly.LoadFrom(strURL)
Dim Version As String
Version = Replace(assemblyContent.FullName, Microsoft.VisualBasic.Left(assemblyContent.FullName, assemblyContent.FullName.LastIndexOf("Version=")), "")
Version = Microsoft.VisualBasic.Left(Version, Version.LastIndexOf(", Culture="))
Version = Replace(Version, "Version=", "")
If My.Application.Info.Version.ToString <> Version Then
Dim typeContent As System.Type
typeContent = assemblyContent.EntryPoint.ReflectedType()
Try
typeContent.InvokeMember("Main", BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.Public Or BindingFlags.InvokeMethod Or BindingFlags.Static, Nothing, Nothing, Nothing)
Catch ex As Exception
SetSecurity(assemblyContent.Location.ToString)
Try
typeContent.InvokeMember("Main", BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.Public Or BindingFlags.InvokeMethod Or BindingFlags.Static, Nothing, Nothing, Nothing)
Catch exp As Exception
WriteToEventLog("Invoking Main(): " & exp.ToString, EventLogEntryType.Error)
'End
End Try
End Try
Try
System.IO.File.Delete(assemblyContent.Location.ToString)
Catch ex As Exception
End Try
End If
Catch ex As Exception
End Try
End Sub
Private Shared Sub SetSecurity(ByVal Location As String)
' Irrelevant code here
End Sub
End Class
modified on Monday, July 21, 2008 12:49 AM
|
|
|
|
|
Hi,
Anyone can tell me if getting the current time of other computer is possible in VB6? I'm not using a SQL Server just VB it self. If possible can someone teach me or give an idea how to do it?
Thanks
Regards,
klaydze
if(you type your code here) {
Messagebox.Show("You help me a lot!");
}
else {
You help me = null;
}
|
|
|
|
|
Where is your vb6 app executing and of which computer you want current time.
Develop2Program & Program2Develop
|
|
|
|