|
So, to summarise: It is NOT a compiler error and your application runs fine. It is just the debugger getting a little confused.
The solution: Don't have such a stupidly large structure in your application. They are not meant to be that large. They are meant to be very small lightweight objects.
|
|
|
|
|
Colin Angus Mackay wrote: It is NOT a compiler error and your application runs fine.
Initially, I was thinking that it might be debugger error. but I tried to bind the result (dataset) with datagrid. but I got no result.
Colin Angus Mackay wrote: The solution: Don't have such a stupidly large structure in your application. They are not meant to be that large. They are meant to be very small lightweight objects.
Yes. thanks. but I hope MS should document about it.
|
|
|
|
|
Michael Sync wrote: I hope MS should document about it.
I'm sure it is documented in several places by Microsoft.
|
|
|
|
|
Colin Angus Mackay wrote: I'm sure it is documented in several places by Microsoft.
documented in several places? yes. that's great. I googled the maximum field limitation of a structure and why it's affected to dataset. but I found none.
|
|
|
|
|
I'm wondering if someone might be able to help me. I've spent a bunch of time on this, read everything I could find, but still can't seem to crack it.
I want to load an assembly .dll into a separate appdomain, from the root directory c:\.
The assembly asm is loaded into the new appdomain fine, BUT ONLY IF ShowForm.dll is in the application default path. I've monkeyed with Applicationbase to request that the load look elsewhere, to no avail. Do I need to specify a security policy?
In any case, is this really the way to load an application into a new appdomain (one which I can subsequently unload)?
Thanks in Advance
Dim Asm = System.Reflection.Assembly.ReflectionOnlyLoadFrom("c:\ShowForm.dll")
Dim ads As New AppDomainSetup()
ads.ApplicationBase = "C:\"
Dim ad As AppDomain = AppDomain.CreateDomain("App2", Nothing, ads)
Dim Asm2 = ad.Load(Asm.fullname)
|
|
|
|
|
Hi Guys,
In a Client/Server application i was writing, i used XML in my own little protocol to send data between the client and the server in a form something like this:
CLIENTID|PROTOCOL_COMMAND_INTEGER|<xml><record><data>I will be you data for today</data></record></xml>|<eof></eof>
Now in the past i've strugled with this xml part because i need encoding that can handle é,è,ç,à and other funny characters like & and stuff..
for this, i could not use datatable.WriteXml(memorystream) (i think) because it always messed up these characters. Being the starting developer that I am , i created a little piece of horrorcode looking like this:
Public Function GetXmlFromRow(ByVal dr As DataRow, ByVal sRecordType As String) As String
Dim sb As New IO.StringWriter
Dim xwXmlTextWriter As New XmlTextWriter(sb)
xwXmlTextWriter.WriteStartDocument()
xwXmlTextWriter.WriteStartElement(sRecordType)
Dim col As DataColumn
For Each col In dr.Table.Columns
xwXmlTextWriter.WriteElementString(col.ColumnName, dr.Item(col).ToString)
Next
xwXmlTextWriter.WriteEndDocument()
xwXmlTextWriter.Flush()
Return sb.ToString
End Function
It isn't pretty.. but it does the job. Now however, i ran into trouble:
i need to send a blob in this XML (a blob which contains another XML file :s). however, i cannot do a ".ToString" from a blob cause it just returns the datatype name as a string.
How can i get a decent formatted XML file from a datatable to send over a socket OR Do i need to rethink my solution completly ? If so: What is the best way/protocol to handle these kinds of things ?
Thanks !
|
|
|
|
|
Hmmm seems you have 2 distinct problems.
1. Unicode in a client dataset - I'm sure it can be done, but I have not had the requirement.
Noctris wrote: How can i get a decent formatted XML file from a datatable
2. Datatabe/set to xlm is simply xmlDataset.writexml(memorystream/variable) I think!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
You will need to run a REGEX session on your string before you send it to your XMLWriter.
Search GOOGLE for xml unsafe characters and ASCII code to see what you should turn those funny characters into. Since you are making your own server / client application you can set your own REGEX standards for conversion of characters.
IE: REGEX finds a "&" in your input string. You replace "&" with a @045; and send that to your XMLWriter.
|
|
|
|
|
I've Searched for hours and still can't find the answer: How would you load an HTML Page from the resources file into a VS.NET WebBrowser Control using VB?
It's an essential part of my application and I'm quite new to VB. Can anybody Help?
|
|
|
|
|
You can do:
WebBrowser1.DocumentText = My.Resources.HTMLFile
Where HTMLFile is the name of the HTML page you added to the Resources.
Alternatively, you could write out the text of the HTML file and then navigate to it:
My.Computer.FileSystem.WriteAllText("c:\file.html", My.Resources.HTMLFile, False)
WebBrowser1.Navigate("c:\file.html")
I don't know of a way just to load the HTML file in the webbrowser control straight from the resources but that may be due to ignorance on my part.
|
|
|
|
|
Thank you for your response. However I'm still having a little trouble.
Apparently My HTML Page is not a member of My.Resources.
Everything else is appearing in the intellisense panel apart from my web page and style sheet.
Has Anybody got any idea why this might be?
|
|
|
|
|
I had problems with adding a resource once for an HTML file. I ended up booting it to the curb and writing my own HTML structure internal.
Below is a quick HTML entry you can stream towards your WebBrowser object and it will work just fine. It builds a basic web page with a table and has simple Java script support VIA a text box entry. I also disabled any right click to view source function with the entry in the body section oncontextmenu=return false;
Give it a try you may find this easier to deal with.
=========================================================================
Dim tik As String = """"
TextBox.Text = "Add some internal Java Script stuff here if you want for a pop up window or what not"
WebBrowser1.DocumentText = "<%@ Page Language=" & tik & "VB" & tik & "%>" & ControlChars.NewLine & "<html><head><meta http-equiv=" & tik & "content-type" & tik & " content=" & tik & "text/html" & tik & ">" & ControlChars.NewLine & "" & _
"<script language=" & tik & "JavaScript" & tik & ">" & ControlChars.NewLine & "" & _
"<!-- hide" & ControlChars.NewLine & "" & _
"" & TextBox.Text & "" & _
"// -->" & ControlChars.NewLine & "" & _
"</script>" & ControlChars.NewLine & "" & _
"</head>" & ControlChars.NewLine & "<body topmargin=" & tik & "0" & tik & " marginwidth=" & tik & "0" & tik & " marginheight=" & tik & "0" & tik & " bgcolor=" & tik & "#FFFFFF" & tik & " text=" & tik & "#000000" & tik & " link=" & tik & "#000000" & tik & " vlink=" & tik & "#000000" & tik & " alink=" & tik & "#000000" & tik & " oncontextmenu=" & tik & "return false;" & tik & ">" & _
"<font size=" & tik & "2" & tik & " face=" & tik & "Arial, Helvetica, sans-serif" & tik & " color=" & tik & "#000000" & tik & "><table border=" & tik & "0" & tik & " width=" & tik & "610" & tik & " cellpadding=" & tik & "0" & tik & " cellspacing=" & tik & "0" & tik & " bgcolor=" & tik & "#FFFFFF" & tik & ">" & _
"<tr><td><font size=" & tik & "2" & tik & ">•<a href=" & tik & " http://www.codeproject.com" & tik & " target=" & tik & "_blank" & tik & "><b> Code Project Rocks! </b></a><br>" & _
"Where would we be without the help of everyone at Code Project?!?!<br><br></td></tr>" & _
"</table></font></body></html>"
|
|
|
|
|
why not save the file as a .txt file and add it to your resources, then save it as an .html file when you need it? ( or keep it a .txt file the whole time? )
How many bytes of text have I typed in my lifetime??? Man, I wish I kept track...
|
|
|
|
|
Hi all
Noob question
I'm using different web services depending on whether I want to connect to the development back end server or the production one. I'd like to choose which web service to use based on a setting in the web.config file. If I use a case statement (or if etc) to define my object the code complains that the object isn't declared.
e.g.
if Appsettings("Debug") = "True" then
dim myObj as new devServer.Service
else
dim myObj as new prodServer.Service
end if
myVar = myObj.somethingClever
name myobj is not declared
Can this be done in some other way?
Thanks
Dave
|
|
|
|
|
Your issue is that myObj exists within the scope of the if statements. Set myVar to be the right service within the code block, or define myObj outside it, so that it's visible outside of the scope of the if statement.
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
Sure, I understand why the example doesn't work. For this trivial example it would be easy enough to define myVar within the code block. However, my question is whether there's another way of approaching this problem.
Dave
|
|
|
|
|
It depends. I would probably put the two web services inside a single property that returns the right one based on the version, so I only do the check in one place. Beyond that, I don't see any better way to do it.
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 )
|
|
|
|
|
We took a different route. When the user logs on they choose the server they want to work against. Typically they may have production, and 2-3 analysis servers they want to connect to. Additionally they can connect to UAT and dev servers by choice.
So we pass in the server name from the UI. Caveat - all the servers must use the same credentials. We do have a different set of creds per application.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Interesting. But how are you actually using the server name in the code? The problem I can't get my head around is how to do this without explicitly using the server when I define my objects.
|
|
|
|
|
Different development paradigm - all my objects are late bound. So during development the form objects are placed and named using a standard convention. A class is created to supply the CRUD and any other processing for each table.
At runtime the class gets the table via the DAL and a utility binds the 1 row to the form elements or dumps the table into a datagridview.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
This is for a Windows Application, not a Web. Anyways I have a Datagrid and I'm setting it's datasource to a table in the database i'm using. If in that table there is a column thats numeric, if i change that numeric column in the datagrid and i enter a non-numeric value and lose focus, the datagrid will catch this on it's own and display a message automatically. But i need to catch this when i click the save button so i can catch all errors at once and display in a single meessage.
If there is any way to disable this or trick the datagrid could someone please let me in on it, because i've been searching for a while and had no luck finding anything.
|
|
|
|
|
Change the numeric field to text and validate on save!
You lose any numeric settings for the column but it won't error
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i have a window service that will alert until a file is read
the ftp write the code below to a log file where sent signify the file has be read
can someone help me with a subroutine in vb .ne that will return boolean indicating whether the file has be read or not
#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2008-06-10 09:04:08
#Fields: time c-ip cs-method cs-uri-stem sc-status
09:04:08 192.168.114.55 [1]USER anonymous 331
09:04:08 192.168.114.55 [1]PASS IEUser@ 230
09:04:16 192.168.114.55 [2]USER anonymous 331
09:04:16 192.168.114.55 [2]PASS IEUser@ 230
09:04:17 192.168.114.55 [3]USER anonymous 331
09:04:17 192.168.114.55 [3]PASS IEUser@ 230
09:04:17 192.168.114.55 [4]USER anonymous 331
09:04:17 192.168.114.55 [4]PASS IEUser@ 230
09:04:42 192.168.114.55 [3]created MS+Pricelist.xls 226
09:14:25 192.168.114.55 [5]USER anonymous 331
09:14:25 192.168.114.55 [5]PASS IEUser@ 230
09:14:25 192.168.114.55 [5]sent /MS+Pricelist.xls 226
09:14:30 192.168.114.55 [5]sent /MS+Pricelist.xls 226
09:19:47 192.168.114.55 [6]USER anonymous 331
09:19:47 192.168.114.55 [6]PASS IEUser@ 230
09:19:47 192.168.114.55 [7]USER anonymous 331
09:19:47 192.168.114.55 [7]PASS IEUser@ 230
09:19:47 192.168.114.55 [7]sent /MS+Pricelist.xls 226
09:19:47 192.168.114.55 [7]sent /MS+Pricelist.xls 226
09:19:47 192.168.114.55 [8]USER anonymous 331
09:19:47 192.168.114.55 [8]PASS IEUser@ 230
09:23:23 192.168.114.55 [9]USER anonymous 331
|
|
|
|
|
About the only thing that comes to mind is to check the System.IO.File.GetLastAccessTime, but quite what you want to do with it is up to you.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
am using ftp
just look at the file give me idea on how to get the sent if you know about log files
|
|
|
|