Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all 3509 articles
Browse latest View live

Issue after windows update

$
0
0

kb2990942 was automatically installed last night, and in that the System.Web.Mvc dll was updated from version 3.0.0.0 to 3.0.0.1.  This caused my builds to fail.  I believe this will happen to all the MVC 4 and 5 projects as well.

I can update the reference, but if I do that, locally it works, but the build machines fail.  If I install kb2990942 on the build machines (they are on a different patch schedule), then the other builds that run on there will be broken.

Was there a reason the version changed?

Is there a way to make it so the build will work with either 3.0.0.0 or 3.0.0.1 installed?

This seems to be shortsighted on the part of MS that would require every build machine and project to be updated.

To recap:

Changing the System.web.mvc.dll version from 3.0.0.0 to 3.0.0.1 is causing a huge pain.  Since we use build machines, and are not able to update every single project to reference a different version, it is quite a quandary.  These projects are also quite old, and changing them to use NuGet will be a large undertaking that the business won't pay for (remember, this was done before NuGet was the norm).

We can easily change the config file to support both when running the application, it comes down to the builds.


Does FxCop support .net 4.0/.net 4.5 ?

$
0
0

Hi ,

I was asked to use FxCop to check the quality of the code.But it seems that FxCop has stopped to support the new .net framework since 2010. As I know that FxCop checks code by reading complied assembly files. Since our solution is complied by .net 4.0/.net 4.5, will FxCop 10.0 still be able to do so? 

Plus, I fount a folder named FxCop  under "Program files\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools", does it mean that FxCop had been integrated into Visual Studio now? Also does it suggest that I don't need to install FxCop separately in that case?

Thanks in advance.

Error After Uploading my ASP.NET Website Which Is using a webservice

$
0
0

Dear Helper 

Intro: I am using vs2005 with .net framework 2. and my web host provides MSSQLSERVER2012

Scenario : I have a simple asp.net website with CRUD function (which it uses a local web-service to work with a my server ms-sql databases) . 

(also I can access my database hosted in server, locally with no problem using some connection string like this in my web-service:
connectionString="Data Source='www.mywebsite.com';User ID='USER_HERE';Password=PASSWORD_HERE;database='DATABASENAME_HERE'"

now when I upload my website it throws this Error :

Server Error in '/' Application.
No connection could be made because the target machine actively refused it 127.0.0.1:57055
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:57055

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SocketException (0x274d): No connection could be made because the target machine actively refused it 127.0.0.1:57055]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +208
   System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) +464

[WebException: Unable to connect to the remote server]
   System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) +6609493
   System.Net.HttpWebRequest.GetRequestStream() +13
   System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +104
   DeviceLocations.Service.working() +28
   _Default.Button1_Click(Object sender, EventArgs e) +31
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9553594
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929 

P.s.

I right clicked on my project name in solution explorer and added a web-reference to my web-service( and as i said all working fine locally) but  Do I need to upload my web-service to my web-host too? is this the problem?! if yes then where (which folder on server) should I uploaded my web-service.

Any Input Appreciated in advance 

aspnet_regsql FAILURE

$
0
0

I am trying to create an aspnetdb.mdb database file for use with Membership/Login. I am using aspnet_regsql and get the following error:

         Unable to connect to SQL Server database

I am well experienced in Expression Web 4 but not experienced in Visual Studio.

What is my problem and what is the solution?

Execute Unit Test Methods Of Different Project In A Solution

$
0
0

I am working on a web application (.Net 4.5, C#) with Visual Studio 2012. I have multiple project as separate components so each project has its own test project. Now I want to execute all Test projects in a single solution. I have started it and added all test projects in single solution, and executed, it works. But now If in any project, there is any change happened so I need to update dll manually by Adding Reference. Is there any option to update dll in some particular location whenever it builds.

Thanks, VD

Eliminate Specific Warnings in VS2013

$
0
0

I am editing a css file in vs2013 and it is giving me a warning for something it shouldn't.  How can I turn off individual warnings in VS?

The replace of web application stress tool

$
0
0

Hi i want  know in 2010 what is the replace of web application stress tool.

what is the new tool for testing application , not Microsoft test manager,  with out a tema foundatin server

a application like jmeter

 

thamks

Table Control Hides Gridview in Design View

$
0
0

I'm using VS Express 2012 for Web.  When I put an HTML table on a page, then place a Gridview in its tablecell (<tr><td>[aspx:Gridview...]</td></tr>), the gridview appears in Design view and its related options menu is available.  But when I try to do the same with an aspx:Table, the Design view does not give access to the Gridview.  However, when I put an aspx:Panel control containing  an aspx:Label control, in an aspx:Table tablecell, the label shows up in Design view.  What's the deal with a Gridview in an aspx:Tablecell?


How do I create a diagonal cell border using EPPlus ASP.NET C#?

$
0
0

How do I create a diagonal cell using EPPlus ASP.NET C#?
 
I am using the following code, but a diagonal is not created in row 83 in Excel.
 
worksheet.Cells[83, 3].Style.Border.Diagonal.Style = ExcelBorderStyle.Thin;
worksheet.Cells[83, 3].Style.Border.DiagonalUp.ToString();
 
I want to create diagonol line in a cell which start up from top left border edge and end on bottom right border end

Compare Files

$
0
0

Using Visual Studio Express 2013, I see an option under: View, Toolbars, Compare Files

By default: Side by Side mode and Auto-synchronize views is On in the toolbar.

But I don't know how to compare two files. For example: "one.sql" and "two.sql" using the Compare Files toolbar

I tried selecting both files and right clicking them, but I see no option to initiate the comparison; and I see no option in the toolbar to run the comparison either.

Any ideas?

Error JavaScript runtime error: Object doesn't support property or method 'bind'

$
0
0

After updating to visual studio 2013 update 3, I am getting the following runtime error on every page with a formview.  

Unhandled exception at line 65, column 3427 in http://localhost:53693/9b3609c5e71a4703b362072b60faa99e/browserLink 0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'bind'. 

The debugger points to this line:  

try { this.addExtension("Microsoft.VisualStudio.Web.BrowserLink.HtmlMappingExtensionFactory", (function(n,t){function k(){var b=this,w=function(n,i){var e,r,u,o;if(!i)return null;if(e=f(i),e)return e.selectorData==n?e:null;if(t(i).is(n.selector)){if(r=null,n.parent){for(u=i.parentElement,o=n.selector.split(">").length-1;o>0;o--)u=u.parentElement;s(n.parent,u)&&(r=t(i.parentElement).children(n.selector))}else n.descendant?t(i).find(n.descendant.selectorData.selector).each(function(i,u){if(s(n.descendant,u))return r=t(u).parents(n.selector),!1}):r=t(n.selector);r&&v(n,r)&&(r.each(function(t,i){if(!p(i)){var u=t%n.elements.length,r=n.elements[u];r&&a(i,r)}}),n.isInTemplateLike||d(n))}return f(i)},s=function(n,t){return w(n.selectorData,t)==n},nt=function(n){for(var u,r,t=0;t<i.length;t++)if(u=i[t],u&&(r=w(i[t],n),r))return r;return null},e=function(n){var t=f(n);return t?t:nt(n)},l=function(n,t,i){if(n<r.length){var u=r[n];if(u)return{sourcePath:u,startPosition:t,length:i}}return null},y=function(t,i){t&&(i==null&&(i=!0),n.invoke("selectRange",t.sourcePath,t.startPosition,t.length,i))},tt=function(n,t,i){return n.sourcePath.toLowerCase()!=t.toLowerCase()?!1:n.startPosition>i?!1:i-n.startPosition>n.length?!1:!0},g=function(n,t,i){var r=n.start,f=n.length,o=r+f,e=n.startTag||0,s=r+e,u=t-i;r>=t?u>=o?(r=t,f=0,e=0):u>r?(f=o-u,r=t,e=u>=s?0:s-u):r+=i:s>t?(u>s?e=t-r:e+=i,u>o?f=t-r:f+=i):o>t&&(u>o?f=t-r:f+=i),n.start=r,n.length=f,n.startTag&&(n.startTag=e)},k=function(n,t){for(var f,e,i,r;t.length>=2;)for(f=t.shift(),e=t.shift(),i=0;i<u.length;i++)r=u[i],r.sourceIndex==n&&g(r,f,e)},c=function(t,i){if(t<r.length){var u=r[t];n.invokeAsync("getChangesInFile",u).continueWith(function(n){k(t,n),c(t+1,i)})}else i()};this.getCompleteRange=function(n){var t=e(n);return t?l(t.sourceIndex,t.start,t.length):null},this.getStartTagRange=function(n){var t=e(n);return t&&t.startTag?l(t.sourceIndex,t.start,t.startTag):null},this.selectCompleteRange=function(n){y(b.getCompleteRange(n))},this.selectStartTagRange=function(n){y(b.getStartTagRange(n))},this.canMapToSource=function(n){return e(n)!=null},this.ensureUpToDateAsync=function(n){n&&h.push(n),o||(o=!0,c(0,function(){var t=h,n;for(h=[],o=!1,n=0;n<t.length;n++)try{t[n]()}catch(i){}}))},this.getElementAtPosition=function(n,i){for(var f=null,o=null,r,e=0;e<u.length;e++)r=u[e],r.start<=i&&r.length>=i-r.start&&(f==null||f.length>r.length)&&(f=r);return f&&t(f.selectorData.selector).each(function(n,t){if(s(f,t))return o=t,!1}),o}}var l=!1,r=[],o=!0,h=[],u=[],i=[],f=function(n){return n?n.__browserLink_sourceMapping||null:null},p=function(n){return f(n)!=null},a=function(n,t){n&&(n.__browserLink_sourceMapping=t)},v=function(n,t){return n.isTemplateLike||n.isParentTemplateLike?t.length%n.elements.length==0:t.length==n.elements.length},c=function(n){var r,o,e,t,f,h,u,s;for(i.push(n),r=i.length-1;r<i.length;r++)for(o=i[r],e=0;e<o.elements.length;e++)if(t=o.elements[e],t){for(f=0;f<t.children.length;f++)h=t.children[f],i.push(h);for(u=0;u<t.ancestors.length;u++)s=t.ancestors[u],i.push(s)}},d=function(n){for(var t=0;t<i.length;t++)i[t]==n&&(i[t]=null)},nt=function(n){return t(n)},g=function(n,i){for(var u=t(n),f=i.split(">"),r=0;r<f.length;r++)u=u.children(f[r]);return u},b=function(n,i){return t(n).parents(i)},y=function(n,t){var i=t(n.selector);v(n,i)?(i.each(function(t,i){var o=t%n.elements.length,r=n.elements[o],u,f;r!=null&&(a(i,r),u=r.children,e(u,0,u.length,null,g.bind(null,i)),f=r.ancestors,e(f,0,f.length,null,b.bind(null,i)))}),n.isTemplateLike&&c(n)):c(n)},e=function(n,t,i,r,u){for(var f=t;f<t+i;f++){if(f>=n.length){r&&r();return}y(n[f],u)}t+i<n.length&&setTimeout(function(){e(n,t+i,i,r,u)},5)},w=function(n,t){e(n,0,10,t,nt)},s=function(n){var v=[],l,o,i,a,e,t,f,h,r,c;if(n)for(l=0;l<n.length;l++)for(o=n[l],i={selector:o[0],elements:[],isTemplateLike:!1},v.push(i),a=1;a<o.length;a++){if(e=o[a],t=null,e){for(f=e[0],h=e.length>=2?e[1]:{},t={selectorData:i,sourceIndex:f[0],start:f[1],length:f[2],startTag:f.length>=4?f[3]:null,children:s(h.children),ancestors:s(h.ancestors)},h.templateLike&&o.length==2&&(i.isTemplateLike=!0,i.isInTemplateLike=!0),r=0;r<t.children.length;r++)t.children[r].parent=t,t.children[r].isParentTemplateLike=i.isTemplateLike,t.children[r].isInTemplateLike=i.isInTemplateLike;for(c=0;c<t.ancestors.length;c++)t.ancestors[c].descendant=t;u.push(t)}i.elements.push(t)}return v};return n.addSharedService("sourceMapping",new k),{onConnected:function(){if(!l&&n.initializationData&&n.initializationData.requestId){var i="~/__browserLink/requestData/"+n.initializationData.requestId;n.invokeAsync("resolveUrl",i).continueWith(function(i){i&&t.ajax(i,{dataType:"json",data:{version:2},cache:!0,success:function(t){l=!0;var i=s(t.map);w(i,function(){n.invokeAsync("resolveSourceFilePaths",t.files).continueWith(function(t){r=t,o=!1,n.sourceMapping.ensureUpToDateAsync(null)})})}})})}}}})); } catch(e) { this.log("Invalid extension script encountered for extension 'Microsoft.VisualStudio.Web.BrowserLink.HtmlMappingExtensionFactory'."); return; }

I can ignore the error and the formview appears to work.

Opening Project in VS produces reports IIS Express error.

$
0
0

I have a project that runs on https://localhost:44306 .  Yesterday by my manager's requirement I published the project for deployment to a test machine for the customers (which also is using IIS Express and is running IIS Express from the command.  However, the IIS Express on that machine for some unknown reason is not able to be configured to use SSL.  Therefore before publishing I changed the project properties so as to run usinghttp://localhost:51716 , and changed SSL Enabled to false.  (I've since discovered that this was not necessary as the web app would run under whatever bindings were entered in applicationHost.config for that web app no matter what it read when it was published.)

However, once the deployment was complete I switched the project back to SSL Enable = true and to run usignhttps://localhost:44306 .  I had to go into the applicationHost.config to put the SSL binding back into the Web site description.  However now whenever I open the project in VS 2012 I get an error message saying:

An error occured when applying the IIS Express settings 
to server URL 'https://localhost:44306' for project 'projectName'. 
You may have to manually edit the applicationHost.config file 
and make changes for your site to run correctly.

Since I've already done that then I am not sure what possible error IIS Express could be experiencing.  There is nothing in the IIS Express log files to indicate that an error even occurred.  Nor is there anything in the Event Viewer logs to show ANY error.  I cannot find any Visual Studio 2012 error logs. 

While one may be attempted to recommend that this thread be posted on the IIS.Net forums, I've found over the past year that the contributors to  that forum are unconversant with IIS Express and do not bother answer queries about it.

So to quote Star Wars;  "Help me Obi-wan Kenobi; you're my only hope."

problem in DataSet

$
0
0

goodmorning,,

how are you all ???

i have problem in visual Studio (asp.net )

when i create DataSet and press Query Builder Button the program visual Studio shutdown

 

plz help me

How to automatically zip Html/css/js/image files when switching to release version?

$
0
0

Hello all:

Web Essential is a very very nice tool for web's development.

However I'd like to automatically zip Html/css/js/image files when switching to release version.

For debug version, do nothing.

How to do with that?

Many thanks!

How to stop VS 2012 from displaying error list when ther are just warnings during file edit?

$
0
0
<div class="votenumber" style="display: block;">Is there a way to stop Visual Studio 2012 from popping up the Error List when there are only warnings? I am writing a .resx file for localization of my sitemap and every time I put .title in my Resource's Name column it generates a warning which then pops up the stupid error list. Is there a way from stopping this stupid list from popping up on only warnings during normal editing of a file. I have tried turning off the Tools -> Options -> Projects and Solutions -> General -> Always show Error List if Build finishes with errors. I have even set the build output to quite but that does not affect it either since these only affect builds and I am just editing not building.</div>

How can I convert/export multiple selected files into one single pdf file

$
0
0

I am trying to create a code that will convert multiple selected files to one pdf file . Currently the code exports the selected files in to a zip file. But I want to open all the selected files in one single pdf file .

For your assistance I am providing the code that exports all files into one zip file.

In the code below there are two table mentioned. one is document and another is vacancyapplication. In the document table all the files are stored guid is the unique id in the document table.

Imports System
Imports System.Web
Imports System.IO
Imports System.Collections.Generic
Imports Ionic.Zip
Imports System.Linq
Imports NLog

Public Class download_bulk_cv : Implements IHttpHandler
    
    Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
        Dim _logger As Logger = LogManager.GetCurrentClassLogger()
        Dim vacancy = New Vacancy(context.Request("v"))
        context.Response.Clear()
        context.Response.ContentType ="application/zip"
        context.Response.AddHeader("content-disposition", "attachment; filename=" & vacancy.Title.Replace(" ", "_") & "_" & Now.ToString("yyyy-MMM-dd-HHmmss") & ".zip")

        Dim files = New List(Of String)()
        For Each docPath As String In From row As DataRow In DB.GetData("select guid, originalfilename from document where id in (select candidatecvid from vacancyapplication where id in (" & context.Request("a").ToString() & "))").Rows Let guid = row.Item("guid").ToString() Select HttpContext.Current.Server.MapPath("~/documents") & "\" & Left(guid, 1) & "\" & Right(guid, 1) & "\" & guid & "." & System.IO.Path.GetExtension(row.Item("originalfilename")).ToLower().Substring(1)
            If File.Exists(docPath) Then
                files.Add(docPath)
                ''_logger.Info(docPath)
            End If
        Next
        Using zip As New ZipFile()
            zip.AddFiles(files.ToArray(), "CVs") '.AddFile(docPath, "CVs")
            zip.AddEntry("info.txt", files.Count.ToString.ToString() & "CVs archived", Encoding.Default)
            zip.Save(context.Response.OutputStream)
        End Using
        context.Response.End()
    End Sub

End Class

The code below converts a single file into pdf. But i need to convert multiple (selected) files into one single pdf.

Public Class candidate_document : Implements IHttpHandler

    Private TheContext As HttpContext
    Private FileSent As Boolean = False
    Private _document As Document
    Private _application As VacancyApplication


    Public Sub ReturnDocument()

        ''convert cv
        If File.Exists(Document.PathOnDisc) Then
            If Document.OriginalFileName.Substring(Document.OriginalFileName.LastIndexOf(".") + 1).ToLower <> "pdf" Then
                Dim path As String = HttpContext.Current.Server.MapPath("~/documents") & "\" & Left(Document.Guid, 1) & "\" & Right(Document.Guid, 1) & "\" & Document.Guid & "." & System.IO.Path.GetExtension(Document.OriginalFileName).ToLower().Substring(1)
                Dim epath As String = HttpContext.Current.Server.MapPath("~/documents") & "\" & Left(Document.Guid, 1) & "\" & Right(Document.Guid, 1) & "\" & Document.Guid & ".pdf"
                If Not File.Exists(epath) Then
                    Converter.ConvertDocument(path, epath)
                End If
            End If

            ''end Convert
        Else
            Throw New InvalidOperationException("Unable to locate file!")
        End If
        If System.IO.File.Exists(HttpContext.Current.Server.MapPath("~/documents") & "\" & Left(Document.Guid, 1) & "\" & Right(Document.Guid, 1) & "\" & Document.Guid & ".pdf") Then


            HttpContext.Current.Response.Clear()
            HttpContext.Current.Response.ContentType = "application/pdf"
            HttpContext.Current.Response.TransmitFile(HttpContext.Current.Server.MapPath("~/documents") & "\" & Left(Document.Guid, 1) & "\" & Right(Document.Guid, 1) & "\" & Document.Guid & ".pdf")
        Else
            Throw New InvalidOperationException("Document could not be located on the disc.")
        End If
    End Sub
    Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
        Try
            TheContext = context
            TheContext.Response.Expires = 0

            If LocalHelper.UserEmployerID > 0 Then
                ReturnDocument()
            Else
                TheContext.Response.ClearHeaders()
                TheContext.Response.ClearContent()
                TheContext.Response.ContentType = "text/html"
                TheContext.Response.Write("<h1>Access Denied</h1>")
                TheContext.Response.Write("<p>You must own the document or have other reasons to access this file.</p>")
            End If
        Catch ex As Exception
            TheContext.Response.Clear()
            TheContext.Response.ContentType = "text/html"
            TheContext.Response.Write("<h1>Error Occured</h1>")
            TheContext.Response.Write("<p>" & ex.Message & "</p>")
        End Try
    End Sub
End Class

 

I am new with vb.net . I appreciate your kind assistance

VS 2013 Corrupting files

$
0
0

I have a simple web application with a number of simple screens for listing records and editing records of lookup tables. There is nothing fancy in it at all. Just simple textbook entry-level code. I create the aspx files and they look and edit just fine. Then I close VS and reopen the solution.

When I reopen the solution some of the files are corrupted. When I double-click on them in Visual Studio Solution Explorer, they come up in Notepad as Chinese characters or something equally weird. It is just some of the files, not all of them, and there is nothing special or different about those files. There is nothing in the files but a gridview, with no code behind them. At the point they are getting corrupted, the files are identical (except for name) to other files that went through the same process and did not get corrupted.

Figuring it was a fluke, I deleted and recreated the corrupted files. I went home thinking that everything was in good shape. I come in this morning, opened the solution and some files are corrupted again, but a different set of files than were corrupted last time. VS 2013 seems to be just randomly corrupting the files.

I searched the net and found someone who had the same problem. The answer given was that it had to do with the Unicode setting, and the BOM. That answer clearly didn't understand the problem. So it ain't that.

Has anyone else had this problem? Anyone got a solution?

Thanks.

How to redirect two step backward after clicking delete button in asp.net and vb.net

$
0
0

In my asp.net and vb.net web application I want User to go 2 steps backward (along with performing the delete action) after they click on delete button.

Currently the system redirects the user to one particular page after delete. But this causes user to click on more pages to go where they were previously because the delete action can be performed in various different locations. So I just want to redirect them where they were (i.e 2 steps backward) after clicking on delete button.

My current code is like below

 Protected Sub btnDelete_Click(sender As Object, e As EventArgs) Handles btnDelete.Click

        If Not VacancyToDelete.TotalApplications > 0 Then
            VacancyToDelete.Delete()
            Response.Redirect("/E4/Jobs/closed.aspx")

        End If

   End Sub

I tried the following line of code but it did not takes user back to the page.it remains on the same page and it feels like nothing has happened.

 btnDelete.Attributes.Add("onClick", "javascript:history.back(); return false;")

Please help me with code. 

Dispatch extension for VS 2013 - anyone know the author?

$
0
0

Hello,

For those of us using website (NOT web application) projects - I was just wondering if anyone might know what happened to the dispatch extension that was once available, found at: 

https://visualstudiogallery.msdn.microsoft.com/a83fc9a6-096c-4c94-8692-14c166ab2f0b

Currently, when working with Visual Studio no facility exists that allow us to upload ONLY those files changed since the last time we Ftp'd to the remote server.  The above extension (from what I can tell did something like this).   I've been unable to contact the author, but if someone knows him or her and can ask to update the extension for VS 2013 -- that would be terrific !

Inserting field text into sql query and comparing values to another table

$
0
0

I have an issue in Visual Web Developer 2010 that I need help with.

The code below is a Gridview Sql query where I'm extracting PART_NUMBER from various tables.  I would like to add the table name in a separate field named Comp Type.  When I use Query Builder in Configure Data Source and run Execute Query the results are what I want.  However when I run the actual program the Comp Type column is empty.

The end result should appear as follows:

PART_NUMBER     Comp Type

010-0075-06        Resistors (or Capacitors, etc.)

Sql query:

SELECT     PART_NUMBER, ('Capacitors') AS [Comp Type]
FROM         Capacitors
EXCEPT
SELECT     PART_NUMBER, ('Capacitors') AS [Comp Type]
FROM         [CIS Manufacturer Parts]
UNION
SELECT     PART_NUMBER, ('Connector') AS [Comp Type]
FROM         Connectors
EXCEPT
SELECT     PART_NUMBER, ('Connectors') AS [Comp Type]
FROM         [CIS Manufacturer Parts]
UNION
SELECT     PART_NUMBER, ('Diodes') AS [Comp Type]
FROM         Diodes
EXCEPT
SELECT     PART_NUMBER, ('Diodes') AS [Comp Type]
FROM         [CIS Manufacturer Parts]
UNION
SELECT     PART_NUMBER, ('ICs') AS [Comp Type]
FROM         ICs
EXCEPT
SELECT     PART_NUMBER, ('ICs') AS [Comp Type]
FROM         [CIS Manufacturer Parts]
UNION
SELECT     PART_NUMBER, ('Inductors') AS [Comp Type]
FROM         Inductors
EXCEPT
SELECT     PART_NUMBER, ('Inductors') AS [Comp Type]
FROM         [CIS Manufacturer Parts]
UNION
SELECT     PART_NUMBER, ('Misc') AS [Comp Type]
FROM         Misc
EXCEPT
SELECT     PART_NUMBER, ('Misc') AS [Comp Type]
FROM         [CIS Manufacturer Parts]
UNION
SELECT     PART_NUMBER, ('Relays') AS [Comp Type]
FROM         Relays
EXCEPT
SELECT     PART_NUMBER, ('Relays') AS [Comp Type]
FROM         [CIS Manufacturer Parts]
UNION
SELECT     PART_NUMBER, ('Resistors') AS [Comp Type]
FROM         Resistors
EXCEPT
SELECT     PART_NUMBER, ('Resistors') AS [Comp Type]
FROM         [CIS Manufacturer Parts]
UNION
SELECT     PART_NUMBER, ('Switches') AS [Comp Type]
FROM         Switches
EXCEPT
SELECT     PART_NUMBER, ('Switches') AS [Comp Type]
FROM         [CIS Manufacturer Parts]
UNION
SELECT     PART_NUMBER, ('Transformers') AS [Comp Type]
FROM         Transformers
EXCEPT
SELECT     PART_NUMBER, ('Transformers') AS [Comp Type]
FROM         [CIS Manufacturer Parts]
UNION
SELECT     PART_NUMBER, ('Transistors') AS [Comp Type]
FROM         Transistors
EXCEPT
SELECT     PART_NUMBER, ('Transistors') AS [Comp Type]
FROM         [CIS Manufacturer Parts]
UNION
SELECT     PART_NUMBER, ('Crystals and Oscillators') AS [Comp Type]
FROM         [Crystals and Oscillators]
EXCEPT
SELECT     PART_NUMBER, ('Crystals and Oscillators') AS [Comp Type]
FROM         [CIS Manufacturer Parts]
ORDER BY PART_NUMBER

The asp portion is below and I suspect I'm missing something:

<asp:TemplateField><HeaderTemplate>
                    Comp Type</HeaderTemplate><ItemTemplate></ItemTemplate></asp:TemplateField>

I have a separate table (CIS Manufacturer Parts) that contains manufacturer data for the above parts.  Multiple manufacturer rows can exist.  The connection between tables in the PART_NUMBER field.  What I would like to do is make this query add the table name to the gridview output listing only parts without manufacturer data and the table they can be found in.

This is a lot for a newbie so I will appreciate any help, thanks!

Viewing all 3509 articles
Browse latest View live




Latest Images