Jump to content

zezu10

Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by zezu10

  1. no those two are declared at the start of the class.
  2. the email sends but the attachment does not work... Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click Dim Counter As Integer Dim sName As String Dim sLastName As String Dim sLocation As String Dim sTelephone As String Dim sSystem As String Dim sDept As String Dim objAttach As MailAttachment Dim postedFile = txtAttachment.PostedFile Dim strPath As String = "" Try strPath = Path.GetFullPath(postedFile.FileName) Catch End Try sName = Trim(txtFirstName.Text) sLastName = Trim(txtLastName.Text) sDept = Trim(txtDept.Text) sLocation = Trim(ddlBranches.SelectedValue) sTelephone = Trim(txtTelephone.Text) 'Set the properties 'Assign the SMTP server obj.SmtpServer = txtSMTPServer.Text 'Multiple recepients can be specified using; as the delimeter 'Address of the recipient Mailmsg.To = txtTo.Text 'Your From Address 'You can also use a custom header Reply-To for a different replyto address Mailmsg.From = "\" & txtFromDisplayName.Text & "\ <" & txtFrom.Text & ">" 'Specify the body format If chkFormat.Checked = True Then Mailmsg.BodyFormat = MailFormat.Html 'Send the mail in HTML Format Else Mailmsg.BodyFormat = MailFormat.Text End If ''Attach the files one by one 'For Counter = 0 To lstAttachment.Items.Count - 1 ' Attachment = New MailAttachment(lstAttachment.Items(Counter)) ' 'Add it to the mail message ' Mailmsg.Attachments.Add(Attachment) 'Next Try objAttach = New MailAttachment(strPath) Mailmsg.Attachments.Add(objAttach) Catch End Try 'Mail Subject Mailmsg.Subject = txtSubject.Text 'Mail Body Mailmsg.Body = "<br>[Client First Name] " + sName + " 'Call the send method to send the mail obj.Send(Mailmsg) End Sub
  3. I am currently trying to design a form which will allow my users to email details to a web daemon, but I am wanting to also allow them to send attachments on this form. Having never done this I searched around and found an example which is asking me to do the following;Change OpenFileDialog Name OFDDefaultExt *.*InitialDirectory c:\Multiselect TrueHow abouts do I go about this? My form for the attachments contains a listbox and two buttons (add attachment, remove attachment)any help would be very much appreciated.
  4. zezu10

    DropDownList Issue

    thank you very much mate, seems I had it in the wrong place.cheers again.
  5. zezu10

    DropDownList Issue

    I currently have a DropDownList that I have populated through a StoredProcedure.It populates ok, however, when I seleted an item down the list, it always returns the one at the top?Could anyone give me any idea of what may be causing this? Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here FillDealerDDL() End Sub Sub FillDealerDDL() Dim GetReader As New GeneralReaderQuery(Constants.LiveGVP, "GetVehiclesFillDDL1") Me.ddlDealerName.DataSource = GetReader.FetchReader Me.ddlDealerName.DataTextField = "DealerName" Me.ddlDealerName.DataValueField = "DealerName" Me.ddlDealerName.DataBind() End Sub
  6. zezu10

    merging searches?

    Done it. For anyone who has this problem ever...I did it by. Sub FillGridCustomerDetails() Dim MyParams As New ParamProperties MyParams.ParamName1 = "@au_customername1" MyParams.ParamVal1 = txtCustomerName.Text MyParams.ParamName2 = "@au_custadd1" MyParams.ParamVal2 = txtCustomerAdd1.Text Dim GetReader As New GeneralReaderQuery(Constants.dataccessname, "storedprocname") Me.GrdVehicles.DataSource = GetReader.FetchDataSet2Param(MyParams) Me.GrdVehicles.DataBind() End Sub
  7. zezu10

    merging searches?

    ok I fixed that small error I had, was a simple typo, grrrr.erm I would like to keep my code vb.net based as much as possible, I do understand your code tho, it's just trying to pass the individual storedproc names that I am currently having trouble with.
  8. zezu10

    merging searches?

    well my searches kinda vary, for example;RegNoChassisNoCustomerNameRegDateAt the moment I have a StoredProc for each search, with each of them passing a specific paramter, ie @au_regdate1 and @au_regno1At the moment I have all the searches working on one form, but that means I currently have 9 text boxes and buttons on my page.It don't look too purdy :/ALSOI have a form working on a webspace, but now when I try to use to it locally, I get a Parser Error? Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Could not load type 'WebApplication1.VehicleSearchForm'.Source Error: Line 1: <%@ Page Language="vb" AutoEventWireup="false" Codebehind="VehicleSearchForm.aspx.vb" Inherits="WebApplication1.VehicleSearchForm" %>Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">Line 3: <HTML> Any ideas?
  9. zezu10

    merging searches?

    hmmm, my stored procedure would have to be edited sufficiently then to try and make it pass the parameter through the search.i'll give it a try.
  10. zezu10

    merging searches?

    the problem I have is that I now have about 7 or 8 searches that I have to do, and am having problems figuring out how to activate different searches with what has been selected by the DDL.I'm filling the grid by doing; Sub FillGridReg() Dim GetDataset As New GeneralReaderQuery(Constants.DATACCESSLINK, _ "STOREDPROCNAME", _ "@au_parameter", _ txtSearch.Text) Me.GrdVehicles.DataSource = GetDataset.FetchDataSet1Param GrdVehicles.DataBind() End Sub So am I going to have to do various IF statements but also how am I going to change the parameter value when the DDL is select?
  11. zezu10

    merging searches?

    Hi guys, I currently have a web form which searches a SQL table, and fills a datagrid.My form currently has two searches, which I have a seperate textbox and button for each, however I am wanting to add more searches to my form, and therefore am looking for the best way to have just the one textbox and button, but allowing multiple searches?Would a dropdown list be a good way to get around this problem, and if so, what is the best way to exectute that way of working around my current problem?
  12. Hi guys, I am trying to build a basic web page, which will search a SQL data by say CustomerNumber, and will pull certain columns of what is in the table for that CustomerNumber.I have never actually queried SQLtables through .NET before and I'm wondering if anyone can point me in the right direction as to how to start/do it.I would like it to be VB.net orientated if possible, to keep it consistant with other applications myself and my office are working on.Can anyone help? it would be much appreciated even to get me in the right direction
  13. Hey. Well, being the eager young man I am I started asking questions, and have more or less discovered that the database that the stylesheet is taking the information from is at fault for the grouped data, therefore the stylesheet is correct, as I tested it on another group of data.But once I get the database fixed I'll give ye all a shout if I have anymore problems.Thanks for your help, MUCH APPRECIATED!
  14. Could I...edit the Templates to help with this?For example there are Templates like... <xsl:template match="TABLE/DATA"><xsl:call-template name="Style"/><xsl:for-each select="//R[generate-id(.)=generate-id(key('DATA',C[6]))]"><table border="0" cellpadding="0" cellspacing="0" width="80%" align="centre"><tr> Would that help? or am I currently holding a load of straws?
  15. no am afraid I can't do that.the output of the stylesheet needs to replicate company invoices, therefore the data must be in columns.I'll tinker with it.I seem to have got some columns to place the data veritically into rows, but for some reason it's not working on the very first column.all the stylesheets I've ever written have been for formatting purposes for websites, never to position database data into a PDF replica type software lol, so am working as I go am afraid :/
  16. no offence takenmy html knowedge is limited, I'm off the dreamweaver and frontpage generation. sorry heh. <xsl:for-each select="key('DATA',C[6])"> <tr class="style16"> <xsl:for-each select="C[position() >= 27 and position() <= 35]"> <td class="style16"> <xsl:value-of select="."/></td> </xsl:for-each> </tr> that at the moment is working, but it's obviously pushing out exactly the same data as I had before. <xsl:for-each select="key('DATA',C[6])"> <tr class="style16"> <td class="style16"> <ul> <xsl:for-each select="C[position() >= 27 and position() <= 35]"> <li><xsl:value-of select="."/></li> </xsl:for-each> </ul> </td> </tr> That however, just placed all the grouped data I have in a one large list, which obviously isn't what is needed.I need 9 columns of data, and all the seperate records in a new line.Sorry if I'm being an utter goon here
  17. As an example.The data that should be pulled up is coming out like.QTY ----- 133When it should beQTY ----- 1 3 3Am not too bothered about the presentation, just that each line of data is in a different line.
  18. so what would be the best way to work around that then? as I've tried to tinker with the coding but the system either doesn't like it or hikes the data all over the page :/I also tried to enter the ranged selection code but it doesn't display that either.I'm using a software program that is specifically for the company, and doesn't display what errors are actually there, which isn't very helpful.As I said I've just been handed this half done code, which supposedly worked when the last person wrote it, but obv, she deleted the file and only left a really bad document.If anyone could help me, I'll buy them a cyber pint
  19. hey guys. in need of some help. obviously :)I've been handed a half done task and asked to fix it, obviously some of you may know the problems of trying to fix other peoples problems but I hope you can do it for me.More or less, what I have is a stylesheet to help output invoice data, and what seems to be happening is in this part of the code <xsl:for-each select="key('DATA',C[6])"> <tr class="style16"> <td class="style16"> <xsl:value-of select="C[27]"/></td> <td class="style16"> <xsl:value-of select="C[28]"/></td> <td class="style16"> <xsl:value-of select="C[29]"/></td> <td class="style16"> <xsl:value-of select="C[30]"/></td> <td class="style16"> <xsl:value-of select="C[31]"/></td> <td class="style16"> <xsl:value-of select="C[32]"/></td> <td class="style16"> <xsl:value-of select="C[33]"/></td> <td class="style16"> <xsl:value-of select="C[34]"/></td> <td class="style16"> <xsl:value-of select="C[35]"/></td> </tr> The problem is that there are multiple lines of data, as in more than one record but what seems to be happening is that in each table of the output, the data is all looped.For example what should look like;ItemItemItemlooks like Item Item ItemIs there anyway around this, I've looked at the properties of value-of select and having found much.This is probably very unclear :/Apoligies.
×
×
  • Create New...