.net - Live Code Runs In IIS And ASP.NET Web Server But Not IIS Express?

Apr 21, 2011

Having recently installed IIS Express I was hoping that it was going to make life easier for me, but I've run into a problem almost straight away.Consider the following which is representative of some live code:

Public Shared Function GetServiceId() As String
Dim principal As MyCustomAuthentication.Principal.MyPrincipal
principal = CType(Thread.CurrentPrincipal, MyCustomAuthentication.Principal.MyPrincipal)

[code]....

Running the code under the ASP.NET Web Server (Cassini) everything is fine and I can see that Thread.CurrentPrincipal is of type MyCustomAuthentication.Principal.MyPrincipal.Running under IIS Express this same line throws an InvalidCastException and checking the type I find it is now of System.Security.Principal.GenericPrincipal which is confusing as nothing else has changed.I can confirm that MyCustomAuthentication.Principal.MyPrincipal implements IPrincipal and remember this is Live code, it is currently deployed and working.

View 1 Replies


ADVERTISEMENT

Event Handler Code Cause A Object Reference Not Set To An Instance Of An Object. Error (only Present On Live Server, Ok On Dev)?

Mar 4, 2010

Here is the code for the button click event;

Protected Sub CompetenciesButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CompetenciesButton.Click
Dim con As String = WebConfigurationManager.ConnectionStrings("foo").ToString()

[code].....

View 1 Replies

Attaching SQL Server Express DB Using Code?

Jan 26, 2012

I am using the following VB code to attach my DBs to server.

Dim cnnConnection As New SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=" & Application.StartupPath + "datafiles" + TextBox1.Text + ".mdf" & ";Integrated Security=True;Database='" & TextBox1.Text & "';Connect Timeout=30")
cnnConnection.Open()

But it gives an error:

Unable to open the physical file "D:.Net ProgramsSQLDBAttachExperimentsSQLDBAttachExperimentsinDebugdatafilesdbSQLtest.mdf". Operating system error 5: "5(error not found)". Cannot attach the file 'D:.Net ProgramsSQLDBAttachExperimentsSQLDBAttachExperimentsinDebugdatafilesdbSQLtest.mdf' as database 'dbSQLtest'.

View 1 Replies

Application Runs On Citrix Server But Not On Virtual Terminal Server

Sep 3, 2009

An application loaded on a citrix server executes with no problem. When we try to run the same program files on a virtual server, we get silent errors and we do not even see the application window appear. The program runs for a moment in task manager, but then closes down. BTW other .net apps run on the virtual server. Here is the error we see in the event viewer application logs[code]...

View 2 Replies

IDE :: VB 2008 Express: Program Runs On PC But Stops Working When Trying To Run .exe On Another Computer?

Jun 3, 2011

And here I am with a new problem in my program When I debug it everything works fine (the buttons, progressbars, pinger, spambot, When I compile it and run the Executable file, it works too.When I run the Executable file on another computer (tried on 4 different ones) the program stops working and
I get this error:

{$ exception. "Failed to create the form For more information, see Exception.InnerException error: File or assembly ." Microsoft.VisualBasic.PowerPacks, Version = 9.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a "or one of its dependencies not found. The system can not find the file specified .."} System.Exception {System.InvalidOperationException}

[Code]...

View 1 Replies

[2008] Express Edition - Convert The Timer So That Instead Of It Running In Milliseconds It Runs In Minutes?

Mar 3, 2009

I im trying to set a time so that the user of my quiz has to do their 20 questions in 40 minutes. i actually have a few questions about the timer. How do you make it so that you canrun this same timer over everyform and then make it stop on the last form? is it possible for you to convert the timer so that instead of it running in milliseconds it runs in minutes?

View 4 Replies

Sql Server - Strategies For Testing Against A Live System?

Dec 1, 2009

Let me describe the scenario:Our VB.NET web application talks to a third party data provider via webservices. It also saves data in a HUGE SQLServer database which has extensive business logic implemented in stored procs and triggers. The webservice provider also employs convoluted business logic which is quite dynamic.

The dilemma is that both the webservice provider and the sqlserver are essentially live systems and our company has no access to them outside of normal operations (web and SQL calls). Neither offer helpful support on their end.Additionally, the webservice has no 'test mode' and all calls are treated as live transactions. It is not possible to mimic the logic in either of these systems, nor is it possible getting a copy of the sqlserver DB.

So, my question is:How do you do any kind of testing (manual or automated) of our VB.NET application against these live systems?

View 2 Replies

Live Chat Code ?

Dec 16, 2010

I need to integrate live chat in my website...How to to get the code for this please? vb codes if its possible...

View 2 Replies

Program Runs Locally In Vis Web Dev But Not On Server

Sep 10, 2010

I created a program in MS Visual Web Developer 2010. It has a form that simply launches a script that manipulates a database. The project lives in several files and they are all inherited so they see each other and it accesses a MSSQL Express DB on one of our servers.

When I F5-Run the project locally on my PC it works fabulously. When I copy it to a web-enabled (application) folder on the server it executes but almost my very first line of code fails with this error[code]...

View 1 Replies

Connect To A Database On SQL Server R2 Express From Visual Basic Express?

Nov 1, 2011

Is it possible to connect to a database on SQL Server R2 Express from Visual Basic Express? I am following a set of tutorial videos done in SQL Server 2005, but cannot seem to connect to create the database. I have created the database in SQL Server R2 Express, but cannot connect. Is there a work around?

View 4 Replies

Connecting VB 2010 Express To SQL Server 2008 Express Database Via IP

Feb 29, 2012

Here is the scoop: I am trying to make a user account SQL database work with Visual Basic 2008 Express for login purposes, i.e. usernames & passwords. Plan is to host this server so people can login to use the the application and verify they have a valid account. I would like to host all the account information in SQL due to the possiblity of hundreds of users at any given time. I also need the ability to add data to the database for users registering for the first time. The SQL server will need to be able to access the SQL Server databases remote via WAN.

View 1 Replies

INSERT Or Update In SQL Server 2008 R2 Express In VB 2010 Express

Jan 21, 2011

I am trying to re write a VB6 program using MS Access, many years ago, using VB 2010 express and SQL server 2008 R2 Express. I have a database with several tables, which I created using the designer. I am able to connect to the database and select data and display it in textboxes etc in vb code. What I have not been able to in code is to INSERT rows DELETE rows or UPDATE any data in the tables. I can do any of these operations using the Query Designer, but I want to do it in code. I can post some code if necessiary, but I thought it might just be some property that I had not set in the designer.

[Code]...

View 13 Replies

Create A Chat That Runs Off Of Mysql And Not A Server?

Apr 23, 2009

I was wondering if its possible to create a chat that runs off of mysql and not a server?

View 4 Replies

SQL Statement Runs In SQL Server- Not In Visual Studio?

Nov 23, 2010

I'm running Visual Studio 2008 and have been told that I have all rights to create #temp tables. I have done this before, but for some reason my sql in the new application always returns 0 rows.I have the SQL connection string stored in my Application events asFriend sqlConnProducts as StringI create a sql string and pass it to the SQLExecute Function

Private Function SQLExecute(ByVal sSQL As String) As DataTable
Dim rtnTable As New DataTable()
Dim sConn As New SqlConnection(My.Application.sqlConRecvInsp)

[code].....

View 3 Replies

Connecting VB 2010 Express To SQL Server 2008 Express Via IP

Feb 29, 2012

there Dream in Code Community! Im an okay programmer as far as skill right now I am still learning as we all are I need some help from some experienced VB.NET programmers in the community, Here is the scoop: I am trying to make a user account SQL database work with Visual Basic 2008 Express for login purposes, i.e. usernames & passwords.

[Code]...

View 2 Replies

XCopy Deployment Of A VB Express App Which Uses A SQL Server Express Database?

May 13, 2005

It's probably just a case of me not looking in the right place or not seeing the obvious, but does anyone know if a machine with just version 2.0 of the .NET Framework should be able to run a VB.NET Express application which accesses a SQL Server Express database file? Or is there an additional requirement for a non-development machine to have some kind of SQL Server Express runtime component in addition to the 2.0 Framework?It seems to be counterintuitive to expect that a VB.NET application would be able to access any kind of SQL Server data without having some kind of SQL Server host component (Express or otherwise) installed. But then again, it seems just as counterintuitive that Microsoft would require the download and installation of the new framework as well as a separate database runtime in order for the average user to run an application with accesses a local SQL Server Express database.To me, it runs contrary to the whole concept of XCopy deployment to require more than just the application's files and .NET Framework for an application to run properly. But nothing I've read so far explicitly indicates that a user would require anything more than the app files and the framework to run an application which accesses SQL Server Express data. But...I can't get any VB Express applications which uses a SQL Server Express databases to run on any machine that doesn't have SQL Server Express installed.What am I missing?(Apologies if this isn't the right group to post this in.

View 3 Replies

Code - Runs Too Slow ?

Jun 5, 2011

I've got a vb.net 2005 form that calls a stored proc to load a combobox with eligible sales reps. There are approximately 40k sales reps available...I know that's a lot, but that's what I'm dealing with. I'm trying to figure out why it's taking this form 15 seconds to load.

Here's my code:

Want to load this in the most efficient way possible given the HUGE amount of data that my client is wanting to see.

Can you help me? :confused:

View 1 Replies

No Code Runs After ExecuteReader()?

Aug 3, 2011

I am using Microsoft visual basic 2010. I am using the following code to connect to a local access database. After the line myReader = cmd.ExecuteReader () no code runs. I am not receiving an error message.

Dim connectionString
As String =
"Provider=Microsoft.ACE.OLEDB.12.0;data source=C:UsersmikeDocumentsFCE_Database.mdb"

[code]....

I have used this method to connect to the same database multiple times in the same program without a problem I've also tried using OleDb with the same result.

View 20 Replies

Proper Update And Delete Code For SQL Express In 2008 Express Edition?

Oct 3, 2011

I'm just using the default SQL Server Express in my vb 2008 express edition as my database server for my database operation. When I tried to update the records on my table I got a runtime error which indicates the error on this line 'myCommand.ExecuteNonQuery()'and it highlights a yellow background on it. The runtime error says "SqlException was unhandled: An expression of non-boolean type specified in a context where a condition is expected, near 'Number'. ".

Imports System.Data.SqlClient
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim myConnection As New SqlConnection
Dim myCommand As New SqlCommand

[code]....

View 3 Replies

Code Runs When Debugging But Stalls In Run Mode?

Jun 15, 2011

i wrote a piece of code to write some data to a card reader, and read back from that device, filling a form with the data (after reformat).When I step through the code while debugging (using F5, F8 for stepping forward) the form is filled correctly.However, when I run the code (Ctrl-F5), the program seems to hang for about 5 sec and then throws an exception: 'Length should be >0' When looking further during debug - it seems that the program calls 2x the Sub Frm_Read_Display(). I

Imports System.Windows.Forms
Imports System
Imports System.IO.Ports
Imports System.Threading

[code]....

View 5 Replies

Xml - When Running Project, Not All Form_load Code Runs?

Mar 10, 2011

this code was just working! but for some reason it stopped to work now. when i run this project the following code is supposed to execute but it does

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim xmldoc As New System.Xml.XmlDocument()

[code]....

View 2 Replies

C# - Software (or CommandLine) That Dynamically Runs Dotnet Code?

May 4, 2012

I once heard about a software that could dynamically run dotnet instructions (C#, if I remember well) on its command line, e.g when entering 1==1, the output would be true.I don't remember the name of this soft, and sometimes one just wants to know the result of a given instruction, without having to create a new program, compiling it and run it...

I would happily take the challenge to make a soft like this on my own later, but for now on I'd just like to find this soft.Does anyone know its name, or another app which would achieve the same result? (Don't tell me PowerShell, I'm searching for something more handy.

EDIT For those who use Visual Studio and who didn't know (I just learnt about it), you can also use the Immediate Window. It even allows you to get intellisense in some cases.

View 4 Replies

Imail Server Express 11.5 Server APi For .Net : Unable To Load DLL 'IMailsec.dll': The Handle Is Invalid?

Sep 30, 2011

I am writing a custom application for IMAIl express 11.5 using IMAIl Server API for .Net

I am using the following code:
Dim DomData As New DomainData()
DomData.Aliases = "TestALias"

[code].....

View 1 Replies

Company App Runs Off Internet Explorer But Can't View The Source Code?

Mar 3, 2011

I'm creating some buttons in Word 2007 that I want to use in my company application to make our teams life easier. The application is a server application but when it loads it goes through our internet explorer.If I could reveal the source code then I could get the ElementbyID to hook up the button to the text field in the application.When the application loads I can quickly right click on view the source code and it is written in C#.This is one of the id's i was able to grab

id="upEnvironmentHidden" value="PRODUCTION"

How can I make it possible to view the source code of this application...also the internet explorer will dissapear and then the application is launched.

View 1 Replies

Forms :: Checks If Certain Variables Have Been Flagged And If So Runs Relevent Code?

Mar 23, 2010

I've almost completed my first VB.Net app which is a rewrite of an old vba app I wrote.The last part that I need to write is the timed events part. What I have in VBA is quite straightforward.Every 500ms the Timer event runs through, it checks if certain variables have been flagged and if so runs the relevent code? Code is nothing major, just updates a networked device.I've looked into timers in .net but it seems like there are various routes that I can go down.

View 10 Replies

VB 2008 & Debugging Simple Code Runs With Variable Assignments Left In Memory?

Sep 16, 2011

I'm running VB2008 on Windows 7; I've written out a ver simple piece of code:

Option
Explicit
On
Module

[code]....

When I run or debug the code, it asks for the First Number and then just completes the running of the program without asking for the second number and uses some random number. The console.readline() doesn't work either, the console window just disappears.

View 2 Replies

Create Logon Using SQL Server Similar To The Windows Live Logon

Aug 20, 2011

I am wanting to create a logon similar to the Windows Live logon, so in other words. user has frmLogon and is located in Australia. The user enters his/her details and then the program connects to a server in the United States and checks the Username and Password to make sure it is correct if it is correct it allows the user to logon and move to the next stage, if it is wrong it will give him an error message. I am wondering if anyone has a tutorial or source code laying around that I can rip apart and see how it works. I want to put the database on my server and connect to it from my desktop using the logon form.

View 3 Replies

Considerations For Choosing SQL Server CE Or SqL Server Express

Nov 15, 2009

Ive been using both SQL Server CE and SQL Server Express. Both are pretty easy to program. What are the considerations for choosing one over the other ?

View 1 Replies

Run Code When Code Runs?

Oct 2, 2009

I was wondering if there is any way to make a sub run when another bit of code has run like doing a handles event bit.The reason I want to know is that I have made a custom message box and would like to effectively create a shortcut by whereby when the string CusMsg (my chosen variable for the message box message) appears in the code and runs, it makes form3 (custom message box form) open and label 1 on that form is the writing the of the message.

View 2 Replies

VS 2010 Connecting VB 2010 Express To SQL Server 2008 Express Database Via IP

Feb 29, 2012

I am trying to make a user account SQL database work with Visual Basic 2008 Express for login purposes, i.e. usernames & passwords. Plan is to host this server so people can login to use the the application and verify they have a valid account. I would like to host all the account information in SQL due to the possiblity of hundreds of users at any given time. I also need the ability to add data to the database for users registering for the first time. The SQL server will need to be able to access the SQL Server databases remote via WAN.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved