|
do you have any user controls in the My User Controls Toolbar that don't exsist any more.
That cauases mine to do that.
just a thought.
|
|
|
|
|
I resolved it!!!!
There was a control (plserver.ocx) in my form wich made the problem.
Eliminating it, the problem disappears!
Thank you for your help.
|
|
|
|
|
Hey I have just opened new project and from that selected VB.Net and from that I selected "ASP.NET Web Application" Clicked Ok. And tried to run it and it shows this error "Error: Unable to Start Debugging on the Web Server" I have also found the alternatives for this error and tried all option given in MSDN online help but still not been able to solve it....
Can anyone plz help me out.....
Regards
Amarelia
|
|
|
|
|
This problem will be nearly impossible to troubleshoot over the forums. The first thing I'd look at, though, is to make sure that there are no errors in your Web.config file. After that, it comes down to problems in your applications project files, web server configuration, security, , code issues, ...
At this point, the only thing we can do is refer you to the KB articles...
Search Results[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi, I have a problem that need someone conver give me the sample that conver from my below code. In VB6 I'm very easy to connect to Ms access database. Here is my code.
Dim dbs As DAO.Database<br />
Dim rst As DAO.Recordset<br />
<br />
Private Sub Form_Load()<br />
<br />
' Connect to database.<br />
Set dbs = DBEngine.OpenDatabase("DbPath")<br />
Set rst = dbs.OpenRecordset("SELECT * FROM [TableName]")<br />
<br />
' Check if there is a record in database.<br />
If rst.RecordCount > 0 Then<br />
' Populate the recordset.<br />
rst.MoveFirst<br />
rst.MoveLast<br />
<br />
' Pass the value of the record to the textbox.<br />
Text1.Text = rst.Fields(0).Value<br />
Text2.Text = rst.Fields(1).Value<br />
End If<br />
<br />
End Sub<br />
<br />
Private Sub cmdAdd_Click()<br />
<br />
With rst<br />
.AddNew<br />
.Fields(0).Value = Text1.Text<br />
.Fields(1).Value = Text2.Text<br />
.Update<br />
End With<br />
<br />
End Sub<br />
<br />
Private Sub cmdUpdate_Click()<br />
<br />
With rst<br />
.Edit<br />
.Fields(0).Value = Text1.Text<br />
.Fields(1).Value = Text2.Text<br />
.Update<br />
End With<br />
<br />
End Sub<br />
<br />
Private Sub cmdDelete_Click()<br />
<br />
rst.Delete<br />
<br />
End Sub<br />
<br />
Private Sub cmdFirst_Click()<br />
<br />
rst.MoveFirst<br />
Text1.Text = rst.Fields(0).Value<br />
Text2.Text = rst.Fields(1).Value<br />
<br />
End Sub<br />
<br />
Private Sub cmdLast_Click()<br />
<br />
rst.MoveLast<br />
Text1.Text = rst.Fields(0).Value<br />
Text2.Text = rst.Fields(1).Value<br />
<br />
End Sub<br />
<br />
Private Sub cmdNext_Click()<br />
<br />
rst.MoveNext<br />
Text1.Text = rst.Fields(0).Value<br />
Text2.Text = rst.Fields(1).Value<br />
<br />
End Sub<br />
<br />
Private Sub cmdPrevious_Click()<br />
<br />
rst.MovePrevious<br />
Text1.Text = rst.Fields(0).Value<br />
Text2.Text = rst.Fields(1).Value<br />
<br />
End Sub
The code that you see above is do the following action:
1. Connect to Database, check if there is record in the database and show it in the text box.
2. Add the record in table.
3. Update the record in the table.
4. Delete record in the table.
5. Navigate through the record.
What I want is sample code to do the following action in VB.NET without using any Adapter control (SqlDbAdapter or OleDbDataAdapter, I need the code only).
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
|
hey guys... ive got this problem.. i dont know how simple this is but i just cant really get the value of my mfc dll returns to my vb app. everything works fine except when the data is of type BSTR.. i only get the first character of the string everytime i called the function in my vb app... i have this structure
struct udtAccessPointsInfo
{
BSTR sysIPAddress;
INT sysPortNumber;
BSTR sysAccessPointID;
BYTE sysStatus;
};
and a function that uses the struct....
LONG GetAccessPointsInfo([out, retval] udtAccessPointsInfo* pAccessPointsInfo)
inside the function i have this line of code for testing...
CString data = "1.1.1.200";
pAccessPointsInfo[0].sysIPAddress = data.AllocSysString();
when i tried to access the values of the struct in my vb app... i only get a string of value "1" which is the start of "1.1.1.200"... i really cant figure out what is really wrong... pls help me.. i think im really a mess with storing a CString to BSTR...
|
|
|
|
|
The code you posted is C#. You might want to try asking this question in the C# Forum.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is this a VB6 or a VB.NET question?
Is the DLL a straight MFC DLL or a COM DLL with MFC support?
|
|
|
|
|
its a vb.net question...but later i will transfer the code to vb6.. can i get both the answers in 6 and .net? its a com dll with mfc support... thanks a lot....
|
|
|
|
|
I hope it can wait for morning. It's 1:00am here and I'll have to dig out some code samples but it's not very hard. I'll post here tomorrow?
You can email me as well to touch base.
mattisking@pobox.com
|
|
|
|
|
thanks a lot... i think i can still wait.. its 1 pm here.. so i still have time till night today to finish it.. thanks!!
|
|
|
|
|
Send me an email if you need a coded example. Otherwise, try this instead:
CString data = "1.1.1.200";
WCHAR strMsg[MAX_PATH];
ZeroMemory(strMsg, MAX_PATH*sizeof(WCHAR));
mbstowcs(strMsg, (const char*)data.GetBuffer(), MAX_PATH);
pAccessPointsInfo[0].sysIPAddress = strMsg;
The only part that throws me a little is your structure. I couldn't "easily" set myself up a small test project passing that structure around... cause I can't remember how to do it because I gladly strode away from BSTR's and VARIANT's 2 years ago when I switched completely to C# and VB.NET. However, that should pretty much do it. I have lots of various examples and ways of doing this so let me know if that doesn't work for you.
|
|
|
|
|
it didnt work for me.... its still one character... i checked my return by putting a sprintf at my code...the whole string is being passed to my vb app.. but only the first character is being seen by the vb app..im sure im passing the structure correctly coz i can see the value of the integer type member of my structue returned... i got this code from one site.. instead of manipulating my mfc com dll.. it manipulates the vb code...its written in vb6 so i had to rewrite my code to vb6....
StringFromBSTR - Convert a BSTR to a VB string
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As _
Any, source As Any, ByVal bytes As Long)
' convert a BSTR into a VB String
Function StringFromBSTR(ByVal pointer As Long) As String
Dim temp As String
' copy the pointer into the temporary string's BSTR
CopyMemory ByVal VarPtr(temp), pointer, 4
' now Temp points to the original string, so we can copy it
StringFromBSTR = temp
' manually clear then temporary string to avoid GPFs
CopyMemory ByVal VarPtr(temp), 0&, 4
End Function
i guess a similar code like that will work for me... i've been trying that code but still no work... pls send me or post a similar code... thanks in advance...
|
|
|
|
|
Try this... this might not be good practice because you'd be allocating memory in C++ and I don't know that VB will clean it up or not...
but try changing your BSTR to BSTR*:
struct udtAccessPointsInfo
{
BSTR* sysIPAddress;
INT sysPortNumber;
BSTR sysAccessPointID;
BYTE sysStatus;
};
CString data = "1.1.1.200";
WCHAR strMsg[MAX_PATH];
ZeroMemory(strMsg, MAX_PATH*sizeof(WCHAR));
mbstowcs(strMsg, (const char*)data.GetBuffer(), MAX_PATH);
pAccessPointsInfo[0].sysIPAddress = SysAllocString(strMsg);
|
|
|
|
|
hi matt.. i cant change the structure they provided for me... it has to be like that.. anyways.. i've already told them about the problem.. still got one issue.. how do i pass an array of struct in vb.net? like for an example..
Structure AccessPointsInfo
Dim sysIPAddress As String
Dim sysPortNumber As Integer
Dim sysAccessPointID As String
Dim sysStatus As Byte
End Structure
Private Declare Function GetAccessPointsInfo Lib "Sample.dll" (ByRef AccessPt As AccessPointsInfo) As Long
i have to pass an array of struct... like... Dim AccessArray(100) As AccessPointsInfo.. i just couldnt find a way....
|
|
|
|
|
You'll need to look into VARIANT arrays. I can't really help you on that one. It's been too long but there are samples here on CP.
|
|
|
|
|
Hi All,
Please provide some clarity to my muddled brain.
I am new to VB.NET and am building some add on customisation to ESRI's ArcGIS suite. I have VS.NET 2003 and am building a VB Class Library project.
My code builds and runs without a hitch on my computer (win2K SP4) but when I build the setup program and deploy on another machine (WinXP SP2) my code installs alright and runs some sections fine, but falls over when it gets to a section requiring stdole saying stdole or one of its dependencys not found.
The target machine has .net 1.1 framework installed and on investigating my .net project I find that the detected dependencies in the setup project stdole is missing reference to mscorlib 1.0.330.0. (I could only find mscorlib 1.05000.0 on my machine)
Further investigation shows that stdole reference is to runtime version 1.0.3705 and file version 7.0.3300.0 yet when I check this file in win explorer it says the file version is 7.0.9466.0.
I can't find any other copies of this file on my machine. Am I somehow referencing a file that no longer exists?? should there be a 1.1 version of stdole??
I have searched and searched and have thus far come up blank.
Any help or explanations greatly appreciated.
Cheers
David
|
|
|
|
|
do you have references to any PIA's?
if you do did you install the latest ones?
|
|
|
|
|
stdole is under the \program file\microsoft.net\primary interop assemblies directory.
I have installed .net framework sp1.
As mentioned above, I am not sure if it is referencing correctly as the reference says file version 7.0.3300.0 but win explorer says stdole.dll file version is 7.0.9466.0.
|
|
|
|
|
are any of these missing from the Windows\System32 or WINNT\System32 folder:
stdole32.tlb
stdole2.tlb
stdole.tlb
|
|
|
|
|
Thanks for the quick reply.
All files exist on my machine under winnt\system32 and client machine under windows\system32
|
|
|
|
|
Mine is the same as yours and I have no trouble in deploying to a new machine. The problem must be somewhere else.
C:\Program Files\Microsoft.NET\Primary Interop Assemblies\stdole.dll
runtime version 1.0.3705 and file version 7.0.3300.0
explorer it says the file version is 7.0.9466.0.
|
|
|
|
|
If you add a setup project to a project with stdole as a reference.
Does the detected dependency refer to mscorlib v1.0330.0?? If so where does this live on your machine.
This is the dependency that seems to be missing from my setup project
I can only locate mscorlb v1.0.5000.0 which live under c:\winnt\microsoft.net\framework\v1.1.4322
|
|
|
|
|
I have these:
mscorelib version 1.0.3300.0 in:
c:\windows\microsoft.net\framework\v1.0.3705\mscorlib.dll
mscorelib version 1.1.4322.2032 in:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\mscorlib.dll
mscorelib version 1.0.2268.0
C:\Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows CE
if I add the reference to stdole it shows the 1.0.3300.0 version.
|
|
|
|