|
This is what I found on the web. I want it to make it work. It describes a bit of it's funcionality but very scarce. Never give up I say. I hopped you could correct it a bit and added some comments. Whell in the datanavigationbar if I am not mistaken there is a textbox that automatically displays the index position of the currenty displayed record. If I write lets say 10 in it and press enter then it automaticaly jumps to record number ten. How can I see the code behind it, I could certainly use the code and learn from it. If I double click on it then I get in the form class another subroutine with click event. the same I would like to se for move next button and save and so.
Don't get upset please cause I don't want anyone to get a stroke or diarea or something like that...
Greetings.
|
|
|
|
|
BOREC wrote: Don't get upset please cause I don't want anyone to get a stroke or diarea or something like that...
LOL - I'm not even remotely upset.
BOREC wrote: I hopped you could correct it a bit and added some comments. Whell
Well, I'm saying that you need instead to do things the right way, write some SQL that requests the data you want from the DB. I gave you the SQL in my first reply, or at least an approximation of what it should be.
The way I would write a method that views one record at a time would depend on the data set. If it was not huge, I'd read it all from the DB and just step over it with my buttons. I'd still not look for records in memory, I'd still write SQL and let the DB do that for me. I'd use my existing functionality then to step over the matches, as my collection would only contain records that match.
http://www.developerfusion.co.uk/forums/p/28135/104686/#104686[^] has a reply showing how to do a dynamic search in Access with VB.NET. It was the first hit when I googled 'vb.net search access database', it looks like a good place to start.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
I write name in textbox1 and click button1 for search:
code:
Private sub Button1_Click(...)
Dim VSearch as String
VSearch = TextBox1.Text
WORK.Recordset.FindFirst(VSearch)
End Sub
although original is
Private sub Button1_Click(...)
Dim VSearch as String
VSearch = "NAME="+TextBox1.Text
WORK.Recordset.FindFirst(VSearch)
End Sub
I WORK table in PhonebookDataSet and in the table fields: name, lastname, officephone, etc.
Please help
|
|
|
|
|
OK - so the problem is solved, or you found another code snippet that doesn't work and you're asking how to make it work ?
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
I'm getting an unusual error message may be I'm wrong here is the error can anyone please tell me how to resolve it:
The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF
And here is the code that raised this error:
Dim wr As HttpWebRequest
Dim wrs As HttpWebResponse
wr = HttpWebRequest.Create("http://www.google.com/")
wr.Method = "HEAD"
wrs = wr.GetResponse()
MsgBox(wrs.Headers.ToString())
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
According to the error message, your code didn't generate the error, Google's web server did. HttpWebRequest is correct is saying so because it's following the parsing rules for HTTP 1.1 headers closer to the RFC specification than Google web server did putting the headers together. It's not Google's fault really, but the people who wrote the web server. There's an old recommendation in the RTF for HTTP 1.0 that said something like:
"the line terminator for message-header fields is the sequence CRLF. However, we recommend that applications, when parsing such headers, recognize a single LF as a line terminator and ignore the leading CR."
The headers comming back from the server ARE, according to which section of the RFC for HTTP you're reading, malformed.
You can turn on an option in your applications app.config file to force HttpWebRequest to relax it's parsing rules and suddenly start working with a large collection of web servers that were never "fixed" because "they worked before!"
<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
</configuration>
|
|
|
|
|
I've done some research before posting this question on Code Project and found the same solution in Msdn forum and did the same thing but it didn't display the headers received from the server but now it did I think there was something wrong with my network connection. As far as solution goes don't you think that Microsoft should make this class more fault tolerant so that it can handle such situations.
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
AliAmjad wrote: As far as solution goes don't you think that Microsoft should make this class more fault tolerant so that it can handle such situations.
They did!! As I've already said, you have to turn this option on in order to use the non-RFC compliant parser. In this particular case, the guy who the HttpWebRequest class wasn't as lazy as the guy who wrote the web server that Google, and tons of other sites, are using.
|
|
|
|
|
Hi guys !!!
can you help me?
How can i send email with vb 2005?
NOt using Outlook or another.
show me an example please
i'm from mexico.....thanks code project !!!
|
|
|
|
|
|
I created a program using visual basic. For some functions the program accesses a dll which was created using visual c++. When the program is run on a computer that does not have visual studio installed, functions which make calls to the dll generate an error:
Unable to load DLL 'filename.dll': This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1).
Reinstalling the application does not help, and when the program is run on a computer that does have visual studio installed, calls to the dll work as expected without generating any type of error.
Is there some component that is installed with Visual Studio that I need to attach to my program installation? Is there some way I can create or access the dll such that it does not need this component?
|
|
|
|
|
What version of Visual Studio was used to create this .DLL?? You're probably missing installing the updated runtimes that the .DLL uses to get this to work. Look in the C:\Program Files\Microsoft Visual Studio version\VC\redist\x86 folder for all the available runtimes. Pick the one that describes what you used to create the .DLL. At a minimum, you'll need to copy the .CRT .dll's to the target machine's Windows\System32 folder.
|
|
|
|
|
Thanks for the suggestion. The development version I am using is Visual Studio 2005 (Also comes up as Visual Studio 8). I tried two different things to try and solve the problem. When I created the install for the program I attached the prerequisite "Visual C++ Runtime Libraries (x86)". So the setup installs the runtime libraries first. This did not solve the problem. Second thing I did was what I think you told me to do. I copied the files from the C:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT\ folder to the target machine's Windows\System32 folder. This did not solve the problem either. There are other folders in the x86 folder: Microsoft.VC80.ATL, Microsoft.VC80.MFC, Microsoft.VC80.MFCLOC, Microsoft.VC80.OPENMP. Should I try copying the dlls from any of these folders as well? Thanks for the help.
|
|
|
|
|
Member 4084928 wrote: There are other folders in the x86 folder: Microsoft.VC80.ATL, Microsoft.VC80.MFC, Microsoft.VC80.MFCLOC, Microsoft.VC80.OPENMP. Should I try copying the dlls from any of these folders as well?
Only if your DLL is using MFC, ATL, or the OpenMP libraries, which I seriously doubt.
In this case, I have no idea. The HRESULT you got usually means that the code you're attempting to run depends on code found in other DLL's, but those dependant DLL's cannot be found, or cannot be loaded for some reason. The missing runtimes is usually the cause of this problem. But, it appears that your DLL is dependant on other DLL's, but you haven't supplied any information on what other libraries your DLL uses.
Other possibilities include the users permissions to the DLL's being loaded, code access security problems, incorrect .config file for the app loading the DLL's, the version of the .NET Framework you developed against is not installed on the target machine, ..., ..., ...
This question would be better asked in the Visual C++ forums.
|
|
|
|
|
OK. I'll try the Visual C++ forums.
Thanks a lot for your time and help.
|
|
|
|
|
I would like to knoe hos to create a file dll and how i can do a reference in an aplication with it´s. thanks.
|
|
|
|
|
ra_shieru wrote: I would like to knoe hos to create a file dll
You create one of the Class Library or Control Library projects.
ra_shieru wrote: how i can do a reference in an aplication with it
This takes considerably more planning as you would have to expose your classes, methods, and events to COM.
Google for "exposing .NET components to COM" for more information. You've got a lot of reading to do.
|
|
|
|
|
Hi I am trying to add a simple function to a COM class in VB.NET with an Optional Array but get an compiler error.
As soon as I add
Public Sub test(ByVal a As Double, Optional ByRef b() As Double = Nothing)
End Sub
I get following error message.
Error 3 The assembly "C:\gui\LCMFinEngLib\LCMQuant01 v3.003.08.dll" could not be converted to a type library. Type library exporter encountered an error while processing 'LCMQuant01.ComClass1+_ComClass1.test(b), LCMQuant01 v3.003.08'. Error: Type mismatch.
When I remove the Optional Statement it compiles without problems. when I define it as a Private function it compiles as well. Are optional arrays not possible in Com classes?
Hope someone can help
|
|
|
|
|
Optional parameters are legal in a COM class. It works for me in a small test project. But, you'll run into a bigger problem when you try an call this method from a COM Client, like ASP, VBA, or VBScript.
Read this[^]. You'll have to expose the parameter as an Object, not a Double() array.
|
|
|
|
|
I need to convert a string to a DataGridViewCell. I tried
" CType(StringHere, DataGridViewCell) " but that does not work. If anybody know anything about this, please reply as this is extremely urgent. Thanks!
<br />
Dim iColIndex As Integer = dsTemp.Tables("GridCellCaption").Rows(iGridColRowCnt).Item("ColNo")<br />
<br />
Dim iRowIndex As Integer = dsTemp.Tables("GridCellCaption").Rows(iGridColRowCnt).Item("RowNo")<br />
<br />
Dim instance As DataGridViewCell = dsTemp.Tables("GridCellCaption").Rows(iGridColRowCnt).Item("Value") ' Here raising exception <br />
<br />
CType(ctr, DataGridView).Item(iColIndex, iRowIndex) = instance
I searched in net no result ....
<br />
Unable to cast object of type 'System.String' to type 'System.Windows.Forms.DataGridViewCell'.
Thanks & Regards,
DVSriram
|
|
|
|
|
For the second time, you cannot convert a String to a DataGridViewCell object.
The code, as you've written it, doesn't say what you want to do with the DataGridViewCell or the String you're trying to convert. It LOOKS like you're trying to put the string INTO a DataGridViewCell, but which one? You don't have any code referencing any existing DGVC.
|
|
|
|
|
Thanks For reply ,
I got the required result in easy way
Thanks
Sriram
|
|
|
|
|
Great! Too bad you never described what that result was supposed to be... Maybe next time.
|
|
|
|
|
Dim instance As DataGridViewCell = CType(ctr, DataGridView).Item(iColIndex, iRowIndex)
instance.Value = dsTemp.Tables("GridCellCaption").Rows(iGridColRowCnt).Item("Value")
Its Working ............
Thanks Dave , Now i can save and retrieve the datagridview from/to xml
vds
|
|
|
|
|
dvsriram wrote: Now i can save and retrieve the datagridview from/to xml
So that's what you were trying to do??
That's easy to do if your data is in a DataTable and you bound the DGV to it. All you would have to do is call the DataTable's WriteXml method. Done.
|
|
|
|