.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

My VS thinks it sees a 0 when it is really a 1

Posted By:      Posted Date: September 19, 2010    Points: 0   Category :ASP.Net

It's really quite ridiculous. I'm staring at my table, which I have refreshed, and I know there is a 1 sitting there in the column. Yet my program says it's a zero. What can be the reason for this anomoly? 


 If Not IsDBNull(adv.TimesRMEmailed) Then
            Response.Write("WE ARE HERE")
            Response.Write("TimesRMEmailed: " & adv.TimesRMEmailed)
            NumRMemails = adv.TimesRMEmailed
            NumRMemails = NumRMemails + 1
        Else : NumRMemails = 1
        End If

I put a 3 in the column and made sure it took. Usually I have to retype the data 5 times until I see a little red circle which tells me that the data took. Why do I always have to do this in the SQL tables?

When I ran my program, rather than print me the 3 which was sitting there, it thinks that the value is 0, then it adds 1 to the number and assigns it fo NumRMEmails. This is absurd....It should be 3+1=4

Why can't it read the value in the column for adv.TimesRMEmailed? It turns it to a zero every time.



View Complete Post

More Related Resource Links

Document is read-only in SharePoint, but user sees "check out" option in Office 2007 / Word / Excel

I am finding that when there is a document library in SharePoint with checkin/checkout required, if a user with read-only ("Visitor") permissions opens a document from that library, the document will open as read-only in Word, Excel, etc., but the user will see the "Server Document" bar with the message "To modify this document, you must check it out" and the "check out" button.  When the user tries to check the document out, they are asked to authenticate, and then receive the error "Cannot perform this operation.  The file has been deleted or someone else has it checked out."    How is it possible to prevent a user with read-only rights in SharePoint from seeing the "Check out" option in Word or Excel?

VS thinks that my var timesemailed is timesRMemailed (another var)


Why can't vs figure out that there are the letters RM inserted in between the letters timesemailed. It's a different variable and also a different column in my table! THis is ridiculous. Now I have to go change my variable name in about 100 places in my code. I thought the program made hashes for each var. Would not the hash for the var timesemailed be different for timesRMemailed? When I print both vars with response.write, I get a 0 for timesRMEmailed when there is actually a 3 in the column for this row. The number 3 is in the timesRMEmailed column in the table and it is accessed by another variable timesemailed....

Ok, I digress, upon close examination of my busineslogic area, my New function was missing the RM and timesemailed got 2 assignments. My mistake. Code carefully!

NetMsmqBinding sees my contract as TwoWay when it is not


I getting an exception:Service cannot be started. System.InvalidOperationException: Contract requires TwoWay (either request-reply or duplex), but Binding 'NetMsmqBinding' doesn't support it or isn't configured properly to support it. My OperationContract states IsOneWay = true.  Below are my contracts and configuration.

[WCF::ServiceContract(SessionMode = WCF::SessionMode.NotAllowed)]
    public partial interface IJobSaleOrderQueue
        [WCF::OperationContract(IsOneWay = true)]
        void SubmitJobSaleOrderQueue(ProductionPlanSvc.WCF.MessageContracts.SubmitJobSaleOrderQueueRequest request);


<service name="ProductionPlanSvc.WCF.ServiceImplementation.JobSaleOrderQueueService" behaviorConfiguration="Default">
            <add baseAddress="net.msmq://localhost/private/JobSaleOrderTransQueue"/>


server login sees all DBs but would like to see just his DB


I have a login mapped to just one DB and is the db_owner on that DB. He is not mapped to any other DBs on the server. But when he logs in, Mgmt Studio shows the all DBs on the server with access denied to all of them except for his DB. This is not bad since he can't get into anything he is not supposed to but it clutters his Mgmt Studio.

How do I make it so that he only sees his DB in Mgmt Studio?

Can't access static member in code, but while running "QuickWatch" sees it. What the?


HI everyone,

I'm working with two Visual Studio 2005 solutions.

The first is "WinX" with a project called "WinX". There's a class in the WinX project in a namespace called "WinX" with a class "frmMain". frmMain is the main form for the application, and is always open.

We have this static member declared as so in frmMain:

public static bool IsfrmViewTaskFormOpen = false;

Enter our second solution "TasksProcessScreen" with a project "TasksProcessScreen" which has a namespace of "TasksProcessScreen" with a public class frmViewTask. The solution has the "WinX" project added as a project.

In frmViewTask, there is the following code:

private void frmViewTask_FormClosed(object sender, FormClosedEventArgs e)


   //This does NOT compile! It says "WinX" does not exists in the current context.

   if (WinX.frmMain.IsfrmViewTaskFormOpen)

SQL Server 2008 Express Management Studio fails to install because it thinks visual studio is instal


I tried to install SQL Server 2008 R1 Express with Tools on Windows Server 2008 R2. It installed, but the management studio failed to install because it said I already had Visual Studio installed and it needed Visual Studio service pack 1 before Management Studio could install.

Visual Studio is nowhere to be found in Programs and Features, and when I try to install Visual Studio SP1, it won't install, saying:

A compatible version of Visual Studio 2008 was not detected on the system. This update is designed for only the Microsoft Visual Studio 2008 (ENU) product family, and is not compatible with any Express editions.

Though I can't find any Express version of SP1 to try, and there is no SP1 in windows update.


SFTP is converting text file format, now SSIS sees an empty file


Using BIDS that came with SQL Server 2008 R2, I created a text file import package.  I used files generated from my local machine for local testing.  However, I find that these files get their format changed after being SFTP'd to the data warehouse.  Not being able to visually see a problem with the text file to be imported, I copied it down to my local machine and compared to one generated at my machine.  Not until I chose "Show All Characters" in Notepad++ did I see the difference: my local file ends its lines with a carriage return-linefeed character, whereas the file that went through SFTP ends its lines with a linefeed character only.

I suspect there's something very basic going on here that I don't know.  I won't ask anybody to explain it, but I'm wondering if there's some way I can import both file formats.  The column numbers and lengths are identical, it's the just line ending character that's different and causing zero rows to get imported.  The only other thing I know to do is recreate my flat file connection, and I haven't even tried that yet.


SQL 2005 thinks a SQL 2000 backup is corrupt, but SQL 2000 restores just fine

I am attempting to move some SQL 2000 databases to SQL 2005. My main production database does not seem to want to move. When I use the SQL 2005 GUI the .bak backup file is marked 'Incomplete'. When I attempt to restore the backup file I get a 'RESTORE detected an error on page (0:0) in database' message. I saw a thread in the SQL Express forum suggesting trying to restore from the T-SQL level to get the GUI out of the picture and I get the same 'error on page (0:0)' message.  However when I take the same file and use SQL 2000 Enterprise Manager it restores with no problems.

Any ideas?

Mike Mattix

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend