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

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


Visual Studio 2010 Report Wizard Error

0
0

I have added a Report Viewer Control to an aspx page in design view.  If I click on the Smart Tag and select "Design a New Report", the Report Wizard starts and immediately displays the error:

The root element of a W3C XML Schema should be <schema> and its namespace should be 'http://www.w3.org/2001/XMLSchema'.


I have Binged and Googled for similar problems to no avail.

Any thoughts on where I have gone awry?

ReportView export only PDF

0
0

Using VS2010, AspNet, C#, SQLServer2008

In ReportView web application, I want to display only the export to PDF option.
not display Word, Excel!
how to do?

Problem reading Excel spreadsheet into SQL in Visual Web Designer 2010

0
0

I'm using Visual Web Designer 2010, VB.  I'm trying to create a routing whereby I can read an Excel file, manipulate the data (by adding additional columns and information) and output it back to Excel.  I found the routine (a starting point) below on the web but cannot get it to work.  The first thing I did was to create an empty table in the SQL database named ExtendedBOM.  The problem is now with Button3, the "For Each dr AS DataRow In ds1.Tables(0).Rows" , I get the message: "Cannot find Table 0." and I'm at a complete loss as to what the problem is.  Does anybody have any suggestions what I can try next?  The spreadsheet I'm trying to read in has 5 columns (Item, Quantity, Part_Number, Reference_Designators, Description) and the first line contains the header text.  Thanks!

Imports System.Data
Imports System.Data.OleDb
Imports System.Data.SqlClient

Partial Class Excel
    Inherits System.Web.UI.Page

    Dim ds1 As New DataSet
    Dim ds2 As New DataSet

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim _filename As String = "C:\new.xls"
        Dim _conn As String
        _conn = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & _filename & ";" & "Extended Properties=Excel 8.0;"
        Dim _connection As OleDbConnection = New OleDbConnection(_conn)
        Dim da As OleDbDataAdapter = New OleDbDataAdapter()
        Dim _command As OleDbCommand = New OleDbCommand()
        _command.Connection = _connection
        _command.CommandText = "SELECT * FROM [Sheet1$]"
        da.SelectCommand = _command
        Try
            da.Fill(ds1, "sheet1")
            Response.Write("The import is complete!")
            Me.DataGridView1.DataSource = ds1
            Me.DataGridView1.DataMember = "sheet1"
        Catch e1 As Exception
            Response.Write("Import Failed, correct Column name in the sheet!")
        End Try
    End Sub

    Dim da As SqlDataAdapter
    Dim conn As SqlConnection
    Dim cb As SqlCommandBuilder

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        Dim conn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("conCString").ConnectionString)
        Dim sel As String = "SELECT * FROM ExtendedBOM"
        da = New SqlDataAdapter(sel, conn)
        cb = New SqlCommandBuilder(da)
        da.MissingSchemaAction = MissingSchemaAction.AddWithKey
        da.Fill(ds2, "ExtendedBOM")
        Me.DataGridView1.DataSource = ds2
        Me.DataGridView1.DataMember = "ExtendedBOM"

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        For Each dr As DataRow In ds1.Tables(0).Rows    'ERROR THIS LINE
            Dim expression As String
            expression = "myId =" + CType(dr.Item(0), Integer).ToString
            Dim drs() As DataRow = ds2.Tables(0).Select(expression)
            If (drs.Length = 1) Then
                For i As Integer = 1 To ds2.Tables(0).Columns.Count - 1
                    drs(0).Item(i) = dr.Item(i)
                Next
            Else
                Dim drnew As DataRow = ds2.Tables(0).NewRow
                For i As Integer = 0 To ds2.Tables(0).Columns.Count - 1
                    drnew.Item(i) = dr.Item(i)
                Next
                ds2.Tables(0).Rows.Add(drnew)
            End If
        Next
        Me.DataGridView1.DataSource = ds2
        Me.DataGridView1.DataMember = "ExtendedBOM"
        da.Update(ds2.Tables(0))
    End Sub
End Class


The asp portion is below:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Excel.aspx.vb" Debug="true" Inherits="Excel" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title></head><body><form id="form1" runat="server"><div><asp:Button ID="Button1" runat="server" Text="Button" /><br /><asp:Button ID="Button2" runat="server" Text="Button" /><br /><asp:Button ID="Button3" runat="server" Text="Button" /><br /><br /></div><asp:GridView ID="DataGridView1" runat="server"></asp:GridView></form></body></html>

Web Deploy (Visual Studio) Code First Migrations

0
0

Visual Studio has the option when doing a web deploy to "Execute Code First Migrations (runs on application_start)". When you select that check box, Visual Studio configures the destination web site so that Entity Framework automatically deploys the database or updates it by running the MigrateDatabaseToLatestVersion initializer on application start, as explained in this VS web deployment tutorial.

My question is... How does it configure the site so Entity Framework automatically deploys the database or updates. What is Visual Studio actually doing to the publish to accomplish this? 

intellisense not working

0
0

Dear All,

i  have problem  when i set identity in web config file like this     <identity impersonate="true" userName="userName" password="password" />

intellisense not work in my project ,i am using VS 2013.

can any one help me?

thanks.

How to use one-click deployment

0
0

I have just completed my first ASP.Net Web application and I need a walk through to use the One-Click deployment to get my application on the server.

Also, when the application is deployed to the server do that mean it will run on the server and do not need any resources on the users PC.

I ask the question because a version of the same application is running on windows on a PC but it can not run on Windows XP because xp does not support certain resources (Framwork 4) etc.

When it is running on the server will the application be able to be access my a pc with XP and still execute OK?

Visual Studio Debugging - no web page - no errors

0
0

Greetings and Salutations,

I  have installed VS 2012.  it is slower then molasses in winter. BUT that is not my real issues.  After install - one: my vs 2005 has been wiped and only BI studio is left,  Two:  when I try to debug in vs 08, 10, or '12 I get no errors but no web pages is display unless I click on the root url in the app dev server box that opens when you click on the app dev icon in system tray.

I guess I can re-install vs '05 but how do I get vs to open my web pages in the debugger?

 

Any advice is appreciated and many thanks for taking time to review my quesion.

GraveDigger

 

 


DLL is out of date

0
0

Migrated from VS2010 to vs2013, compiled any application and it worked, but when run command gives the following message below:

--------------------------
Microsoft Visual Studio
---------------------------
The Debugger Resource DLL is out of date. If this problem persists, use 'Add or Remove Programs' in Control Panel to repair your Visual Studio installation.
---------------------------
OK
---------------------------

Site administration tool VS2013

0
0

Accessing the site administration tool in visual studio 2013?
I need to create user and functions, I want to configure security! I do not know where is the tool in VS2013.

Export selected sql tables to Excel as separate pages

0
0

I'm using Visual Web Designer 2010, VB.  I would like to know if there is a way to export selected Sql tables (approximately 13) to Excel, placing them all in the same spreadsheet but placing each table on a separate Excel (2003) worksheet?  Can this be done with one single command (I hope) or would it be necessary for a separate command for each table?  I'm a newbie and this is above my level at this point.  Thanks!

JQuery missing (not loading) error on IE 11 on MVC 5 after publish

0
0

Hi,

I have developed one asp.net application with MVC 5 and I used couple of javascript framework like

  • JQuery 2.1.1 
  • Knockout.js 3.2.0
  • Bootstrap.js 
  • Bootstrap.datepicker,js 

Application is running fine when I run from VS2013 on IE & Chrome.

But After I publish my application on web server and if I try to access my application from different computer or client I am facing below errors on Internet Explorer 11 only. I am not facing any error on Chrome of any versions. 

  • Object doesn't support property or method 'addEventListener'
  • Bootstrap requires jQuery
  •  'jQuery' is undefined
  • The value of the property '$' is null or undefined, not a Function object

But if I try to access my published application from server itself with http://localhost:<port>/ then everything works fine but if I try to access withhttp://<computername>:<port> problem will continue. 

Note: I have updated my IE with latest version. 

VS 2013, not let it check in web.config

0
0

I'm running the free version of TFS via visual studio .com and was wondering if there's a way in VS 2013 to never let it check in web.config. Probably a TFS question but I didn't know where else to post. I did some searching but couldn't find anything that worked. 

Sending email via SMTP only works when the From field is Hard coded but does not otherwise. How can I fix it? In ASP.net and VB.net Web Application

0
0
        Public Sub Send()

            Dim Message As New System.Net.Mail.MailMessage
            With Message
                .Subject = Me.Subject
                .Body = Me.Body
                .From = New MailAddress("noreply@portals.mypbiz.com", "Careers portal")

                AddAddressString(Me.MailFrom, .ReplyToList)
                .Sender = New MailAddress("noreply@portals.mypbiz.com", "Careers portal")
                AddAddressString(Me.MailTo, .To)
                AddAddressString(Me.MailCC, .CC)
                AddAddressString(Me.MailBCC, .Bcc)
                .IsBodyHtml = True
                If Not IsNothing(Attachments) Then
                    If Attachments.Length > 0 Then
                        For Each FileName As String In Split(Attachments, ";")
                            FileName = Replace(FileName, "~/", System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath & "/")
                            If FileName.StartsWith("/") Then
                                FileName = System.Web.HttpContext.Current.Server.MapPath(FileName)
                            End If

                            Try
                                Message.Attachments.Add(New System.Net.Mail.Attachment(FileName))
                            Catch
                                System.Web.HttpContext.Current.Response.Write(FileName & " could not be found")
                                ''System.Web.HttpContext.Current.Response.end()
                            End Try
                        Next
                    End If
                End If

                If DocumentIDs IsNot Nothing Then
                    For Each DocumentID As Integer In DocumentIDs
                        Dim Doc As New Document(DocumentID)
                        If System.IO.File.Exists(Doc.PathOnDisc) Then
                            Dim Attatchment As New System.Net.Mail.Attachment(Doc.PathOnDisc)
                            Attatchment.Name = Doc.OriginalFileName
                            Message.Attachments.Add(Attatchment)
                        End If
                    Next
                End If

            End With

            Try
                Dim Client As New System.Net.Mail.SmtpClient
                ''With Client

                ''    .Credentials = New NetworkCredential("admin@mypbiz.com", "$Ropic$new$t@_ge1!")
                ''    .DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
                ''    .Host = "mail.mypbiz.com" 'WebConfigurationManager.AppSettings("smtpserver")

                ''    .Send(Message)
                ''End With


                With Client
                    If WebConfigurationManager.AppSettings("smtpserver").Length > 0 Then
                        .DeliveryMethod = Net.Mail.SmtpDeliveryMethod.SpecifiedPickupDirectory 'Net.Mail.SmtpDeliveryMethod.Network
                        .PickupDirectoryLocation = "c:/outbox/"
                        .Host = WebConfigurationManager.AppSettings("smtpserver")
                    Else
                        .DeliveryMethod = Net.Mail.SmtpDeliveryMethod.PickupDirectoryFromIis
                    End If

                    .Send(Message)
                End With

            Catch Ex As Exception
                _error = Ex.Message
                'System.Web.HttpContext.Current.Response.Write(_error.tostring)
                'System.Web.HttpContext.Current.Response.end()
            End Try


            Dim Query As String = ""

            Query &= vbCrLf & "IF @id != 0"
            Query &= vbCrLf & "BEGIN"
            Query &= vbCrLf & "    UPDATE emaillog SET error=@error, mailfrom=@mailfrom, mailto=@mailto, mailcc=@mailcc, mailbcc=@mailbcc, subject=@subject, emailcontentid=@emailcontentid WHERE id=@id;"
            Query &= vbCrLf & "    SELECT @id;"
            Query &= vbCrLf & "END"
            Query &= vbCrLf & "ELSE"

            Query &= vbCrLf & "BEGIN"
            Query &= vbCrLf & "    INSERT INTO emaillog (error, mailfrom, mailto, mailcc, mailbcc, subject, body, emailcontentid) VALUES (@error, @mailfrom, @mailto, @mailcc, @mailbcc, @subject, @body, @emailcontentid);"
            Query &= vbCrLf & "    SELECT SCOPE_IDENTITY();"
            Query &= vbCrLf & "END"

            _id = Core.DB.GetInteger(WebConfigurationManager.ConnectionStrings("logConnectionString").ConnectionString, Query, _
                Core.DB.SIP("id", _id), _
                Core.DB.SIP("error", _error), _
                Core.DB.SIP("emailcontentid", Me.ContentID), _
                Core.DB.SIP("mailfrom", IIf(IsNothing(Me.MailFrom) = True, "", Me.MailFrom)), _
                Core.DB.SIP("mailto", IIf(IsNothing(Me.MailTo) = True, "", Me.MailTo)), _
                Core.DB.SIP("mailcc", IIf(IsNothing(Me.MailCC) = True, "", Me.MailCC)), _
                Core.DB.SIP("mailbcc", IIf(IsNothing(Me.MailBCC) = True, "", Me.MailBCC)), _
                Core.DB.SIP("subject", IIf(IsNothing(Me.Subject) = True, "", Me.Subject)), _
                Core.DB.SIP("body", IIf(IsNothing(Me.Body) = True, "", Me.Body)))

        End Sub

Hello Everyone

The above code is for my email sending function. 

This works perfectly fine.

But as you can see  in the from field is Hard coded. (see below again) 

                .Subject = Me.Subject
                .Body = Me.Body
                .From = New MailAddress("noreply@portals.mypbiz.com", "Careers portal")

                AddAddressString(Me.MailFrom, .ReplyToList)
                .Sender = New MailAddress("noreply@portals.mypbiz.com", "Careers portal")
                AddAddressString(Me.MailTo, .To)
                AddAddressString(Me.MailCC, .CC)
                AddAddressString(Me.MailBCC, .Bcc)
                .IsBodyHtml = True

But I want to change it. In my front end there is text box to provide the email address for from field , To field , CC and BCC.  But as the from field is  hard coded the email always comes from noreply@portal.mypbiz.com 

how can I fix it so that the email will be sent from the email address provided by the user in front end.

I have changed hard coded line and tried the following code .but then i don't receive any email i.e the email sending doesn't work.

  With Message
                .Subject = Me.Subject
                .Body = Me.Body
                 .From = New MailAddress(Me.MailFrom, "Careers portal")

                AddAddressString(Me.MailFrom, .ReplyToList)
                .Sender = New MailAddress(Me.MailFrom, "Careers portal")

                AddAddressString(Me.MailTo, .To)
                AddAddressString(Me.MailCC, .CC)
                AddAddressString(Me.MailBCC, .Bcc)

Though I can see that  Me.Mail From contains the email address provided in the front end field when I debug the code.

But No email is received and I get the following error with the changed code. 

Server Error in '/' Application.

<div align="center">
</div>

The specified string is not in the form required for an e-mail address.

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.FormatException: The specified string is not in the form required for an e-mail address.

Source Error: 

 

Line 276:                .Body = Me.Body

Line 277:                ''.From = New MailAddress("noreply@portals.mypbiz.com", "Careers portal")

Line 278:                .From = New MailAddress(Me.MailFrom, "Careers portal")

Line 279:

Line 280:                AddAddressString(Me.MailFrom, .ReplyToList)


Source File: D:\site\V4\Test\Portals\App_Code\core\Email.vb    Line: 278 

Stack Trace: 

 [FormatException: The specified string is not in the form required for an e-mail address.]

   System.Net.Mail.MailAddressParser.ParseAddress(String data, Boolean expectMultipleAddresses, Int32& index) +2604660

   System.Net.Mail.MailAddress..ctor(String address, String displayName, Encoding displayNameEncoding) +304

   Core.Email.Send() in D:\site\V4\Test\Portals\App_Code\core\Email.vb:278

  

We are using HMAIL server 

Can you please help me to fix this. 

I have tried to be specific . But as the problem is bit complex I understand my description may not be enough. Please let me know if you need further details.

i will be grateful 

web custom server control in Visual Studio 2013

0
0

Hi,

I want to create a web custom control. I am using Visual Studio 2013., but I did not appropriate project type in VS 2013. Can anybody please help me how to create a new project for a custom control?

Regards,
Girish


update html content in preview window, then sync the updates in the visual studio.

0
0

It is said that with visual studio, perhaps with web essential as well? the web developer can review the html page in the browser during debug/preview? then  update the html content in the review page, then the html content updates can be saved to the original html page in visual studo?

How to find the feature and enable it? I tried it with my visual studio 2013 update4, seems it didn't work. if you have the instruction/steps, it is greatly appreciated.

Jun

VSE 2013 Output to console

0
0

No option available  at New Project >>C#>>Class  

Compress/Expand VB Server Script in .aspx Page

0
0

I'm using VSE 2012 Express.  VB code placed in class modules have expand/collapse icons ( small box with + or -) which are very helpful. 

These icons also show up in the HTML body of .aspx pages, but not in the server script included in these pages.

Is there a setting or option to have those icons show up in server script included in .aspx pages? 

Thanks

Is there a button that shows where calls are made to a function or procedure?

0
0

I know I used to have one back in the days of "classic" VB. It might have been part of a plugin to the IDE.

In the code editor you could put the cursor inside a function or procedure and click this toolbar button and it would pop up a list of all the places in your code that called the thing your cursor was in. Very useful when you have a lot of code.

I can't find it in VS2013.

Does it exist?

TableAdapter Configuration Wizard Not Responding As Expected

0
0

I have recently upsized a MS Access database to SQL Server 2008 using the upsizing wizard.  Now I want to begin designing my Data Access Layer.  I am following a set of tutorials located here as the basis for my design: http://www.asp.net/web-forms/overview/data-access/introduction/creating-a-data-access-layer-vb  I am using Visual Studio .Net 2010 and the SQL Server database is 2008.  I realize that these tutorials were written for VS 2005 but I have used them successfully with other versions of Visual Studio.  I'm not sure what is happening here and I would appreciate any assistance you can provide.

 

I have created the web site project and added both the App_Data and App_Code folders to my project.  I have put a copy of my SQL Server database files into the App_Data folder.  Server Explorer shows a successful connection to the database.  However when I add a Typed DataSet to my project events do not proceed as they should according to the tutorial.  I am prompted to move the Dataset into the App_Code folder and I respond Yes, but the TableAdapter Configuration Wizard does not start as the tutorial says it should, nor as I remember it should from my past experince.  I'm not sure what is happening here and I would appreciate any help you can provide.

Viewing all 3509 articles
Browse latest View live




Latest Images