Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
P

partt

@partt
About
Posts
63
Topics
31
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • conditional postback
    P partt

    Whenever I select the city in the dropdown, it reloads and I lose which city I selected, what am I doing wrong here?: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Page.IsPostBack Then ddCity.SelectedIndex = ViewState("ddI") End If End Sub Private Sub ddCity_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddCity.SelectedIndexChanged ViewState("ddI") = ddCity.SelectedIndex End Sub Thank you for your continued support!

    ASP.NET csharp help question

  • conditional postback
    P partt

    Where do you put the "if postback" part?

    ASP.NET csharp help question

  • conditional postback
    P partt

    I've tried too many things to make this work and can't quite get it right, so here it is: I have a VB.Net webform with a textbox(txtZip) that accepts a ZipCode, it's set to autopostback. Upon that autopostback, it populates a dropdown with all cities that are associated with that ZipCode. There are other textboxes on the page that cause postback and some buttons too. I only want the dropdown to load when txtZip caused the postback, otherwise I lose which city was selected in the dropdown. Anyone out there have any true-tested code that will work? Thanks for any help!

    ASP.NET csharp help question

  • vb.net winform move folder
    P partt

    I can't find a simple way to move a folder from one place to another without identical roots (directory.move, file.move), or even better, copy a folder, then paste it into another directory(without identical root).

    Visual Basic csharp

  • vb.net Shell() successful?
    P partt

    Thanks!

    .NET (Core and Framework) csharp linux xml help

  • vb.net Shell() successful?
    P partt

    I execute the following command, but want to see if it successfully created the xml file: cmd = "bcp ""select * from dbName..tableName where StudyNo = " & SN & """ queryout c:\tResultQue.xml -c -S servername -U uname -P pwd" Shell(cmd) I tried the following, but it won't work as it executes before the file is created: If File.Exists("c:\tResultQue.xml") Then 'success Else 'failed End If Thank you for any help!

    .NET (Core and Framework) csharp linux xml help

  • VB.Net/Copy SQL table
    P partt

    That's the one, thanks!

    Visual Basic database csharp sql-server sysadmin

  • VB.Net/Copy SQL table
    P partt

    Somewhere in the past couple years I heard that VB.Net has something built in that will copy a SQL Server table(including schema) to a file. Now that I want to use it, of course I can't find anything on it. Anyone familiar with this?

    Visual Basic database csharp sql-server sysadmin

  • VB.Net command line app
    P partt

    I have a vb.net windows app and I want it to execute a command line like this: bcp "select SiteID, SiteName from MYDB..Mytable" queryout c:\Test.txt -c -S MyServer -U uname -P pwd How can I get vb to execute this? Thanks in advance

    Visual Basic question csharp

  • Sessions lost
    P partt

    When a user logs in to my web app, I save their login id as Public Shared so that I can reference it later. Sometimes when it is referenced later, it will grab the login id from someone else's session who is also running the app. I tried saving the login id as Session("loginid"), it works ok for a while, then it loses it and goes to null. No messages are coming up saying that the session has been lost, any ideas on what could be wrong or how to fix this would help out a lot. Thank You!

    Visual Basic help tutorial

  • Print Dialog
    P partt

    How can I open the PrintDialog in a WEB form? I have a crystalreport that I want to send directly(not to pdf, etc.) to a printer on the clients local machine. I've found a way to display available printers(System.Drawing.Printing.PrinterSettings.InstalledPrinters), but it only displays printers on the server, not local. Thank you for any help!

    Visual Basic question graphics sysadmin help

  • Adding Ranking Column (just a column incrementing by 1 each row) to datagrid
    P partt

    I'm sure there is a way around it, I'm not familiar with it though, it's not considered "best practice". www.msdn.com may help, or maybe you could post a topic based on that.

    Visual Basic tutorial question

  • Adding Ranking Column (just a column incrementing by 1 each row) to datagrid
    P partt

    If you are using a stored procedure, you should probably take care of any joining you want to do there. Just use the vbDataGrid for display. If you go this way I've found www.sqlteam/forums to be very helpful if you are unsure of how to put that stored procedure together. Good luck

    Visual Basic tutorial question

  • Adding Ranking Column (just a column incrementing by 1 each row) to datagrid
    P partt

    Public Shared Function Rank() As DataTable Dim ds As DataSet = SqlHelper.ExecuteDatase(ConfigurationSettings.AppSettings(myProj.ConnectionString), "usp_GetRankedList") Dim dt As New DataTable() dt.Columns.Add("Rank") dt.Columns.Add("Name") Dim r As DataRow Dim workRow As DataRow Dim i As Integer = 1 For Each r In ds.Tables(0).Rows workRow = dt.NewRow workRow("Rank") = i workRow("Name") = r("Name") dt.Rows.Add(workRow) i += 1 Next Return dt End Function Watch for line break! Have fun!

    Visual Basic tutorial question

  • Urgent Help Needed Vb.Net ReportViewer
    P partt

    Using the code below, I display a Crystal Report. The Crystal Report is populated by a view in sql server. Every time I run this, it always displays the same data, no matter what is in the view. Doesn't make any sense to me. 'Update view with new records Dim sc As New PK.BusinessLogicLayer.Schedule() sc.StudyNo = txtStudyNo.Text.Trim sc.PrintQCS() Dim QCSDoc As New ReportDocument() QCSDoc.Load("C:\Inetpub\wwwroot\x\Quota_Control.rpt") Dim logonInfo As New TableLogOnInfo() Dim i As Integer For i = 0 To QCSDoc.Database.Tables.Count - 1 logonInfo.ConnectionInfo.ServerName = serverName logonInfo.ConnectionInfo.DatabaseName = databaseName logonInfo.ConnectionInfo.UserID = uid logonInfo.ConnectionInfo.Password = pwd QCSDoc.Database.Tables.Item(i).ApplyLogOnInfo(logonInfo) Next CRV01.DisplayToolbar = False CRV01.DisplayGroupTree = False CRV01.BestFitPage = True CRV01.ReportSource = QCSDoc

    Visual Basic database csharp sql-server sysadmin

  • Print file VB.Net
    P partt

    I know I'll get hell for this one....How do I print a PDF file from vbnet? My code is below which populates a crystal reports document and saves it as a pdf, how can I print it now? Dim sc As New PP.BusinessLogicLayer.Schedule() sc.ScheduleStamp = Session("Sch") sc.StudyNo = txtStudyNumber.Text.Trim sc.AQ = Session("AQ") sc.PrintTopSheet() Dim CRDoc As New ReportDocument() CRDoc.Load("C:\w\x\y\z.rpt") Dim logonInfo As New TableLogOnInfo() Dim i As Integer For i = 0 To CRDoc.Database.Tables.Count - 1 logonInfo.ConnectionInfo.ServerName = serverName logonInfo.ConnectionInfo.DatabaseName = databaseName logonInfo.ConnectionInfo.UserID = uid logonInfo.ConnectionInfo.Password = pwd CRDoc.Database.Tables.Item(i).ApplyLogOnInfo(logonInfo) Next Dim crExportOptions As ExportOptions Dim crDiskFileDestinationOptions As New DiskFileDestinationOptions() Dim Fname As String Fname = "\\a\b\c.pdf" crDiskFileDestinationOptions.DiskFileName = Fname crExportOptions = CRDoc.ExportOptions With crExportOptions .DestinationOptions = crDiskFileDestinationOptions .ExportDestinationType = ExportDestinationType.DiskFile .ExportFormatType = ExportFormatType.PortableDocFormat End With CRDoc.Export()

    Visual Basic question csharp database

  • Making one cell in a DataGrid bold
    P partt

    Private Sub myDataGrid_ItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs) Handles myDataGrid.ItemDataBound If CType(e.Item.Cells(2).Text, Integer) > 10 Then e.Item.Cells(2).ForeColor = Color.Red End If End Sub You can put in something like this. A datagrid is zero-based, so this(cells(2)) would be the third column from the left. Have Fun!

    Visual Basic sales question

  • ReportDocument won't Export / vbnet
    P partt

    I'm using the following code. I want to send a populated CrystalReport to a location as a PDF when the Totals button is clicked. When I keep what is between the *'s, nothing gets exported, there are no errors either. When I comment out what is between the *'s, the unpopulated .rpt file gets sent to the destination as a PDF. Please Help! Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not Page.IsPostBack Then Dim tDay As Integer Dim tCall As Integer Dim DD As DateTime Dim CallActivity As DateTime tDay = Integer.Parse(txtPast.Text) tCall = Integer.Parse(txtCall.Text) DD = Today.AddDays(-tDay) CallActivity = Today.AddDays(-tCall) Dim UD As DateTime UD = lblUpDOB.Text.Trim Dim LD As DateTime LD = lblLowDOB.Text.Trim SetReportParam(txtGender.Text, txtRace.Text, UD, LD, ddlSite.SelectedItem.Value, DD, CallActivity) End If End Sub Private Sub SetReportParam(ByVal SexID As String, ByVal RaceID As String, ByVal UpDOB As DateTime, ByVal LowDOB As DateTime, ByVal SiteID As String, ByVal DD As DateTime, ByVal CallActivity As DateTime) rDoc1.Load("path to .rpt") Dim logonInfo As New TableLogOnInfo() Dim i As Integer For i = 0 To rDoc1.Database.Tables.Count - 1 logonInfo.ConnectionInfo.ServerName = "servername" logonInfo.ConnectionInfo.DatabaseName = "dbname" logonInfo.ConnectionInfo.UserID = "uid" logonInfo.ConnectionInfo.Password = "pwd" rDoc1.Database.Tables.Item(i).ApplyLogOnInfo(logonInfo) Next Dim paramFields As New ParameterFields() Dim paramField As New ParameterField() Dim discreteValue As New ParameterDiscreteValue() Dim rangeValue As New ParameterRangeValue() paramField.ParameterFieldName = "SexID" discreteValue.Value = SexID paramField.CurrentValues.Add(discreteValue) paramFields.Add(paramField) paramField.ParameterFieldName = "RaceID" discreteValue.Value = RaceID paramField.CurrentValues.Add(discreteValue) paramFields.Add(paramField) paramField.ParameterFieldName = "LBirth" discreteValue.Value = UpDOB paramField.CurrentValues.Add(discreteValue) paramFields.Add(paramField) paramField.ParameterF

    Visual Basic database help question

  • EXPORT PDF from VB.NET
    P partt

    I tried this but it gives me an error: "Invalid Field Name" Dim crReportDocument As ReportDocument Dim crExportOptions As ExportOptions Dim crDiskFileDestinationOptions As DiskFileDestinationOptions Dim Fname As String crReportDocument = New ReportDocument() crReportDocument.Load("destination to .rpt") Dim logonInfo As New TableLogOnInfo() Dim i As Integer For i = 0 To crReportDocument.Database.Tables.Count - 1 logonInfo.ConnectionInfo.ServerName = "servername" logonInfo.ConnectionInfo.DatabaseName = "DBname" logonInfo.ConnectionInfo.UserID = "userID" logonInfo.ConnectionInfo.Password = "passWord" crReportDocument.Database.Tables.Item(i).ApplyLogOnInfo(logonInfo) Next Dim discreteParam As New ParameterDiscreteValue() Dim paramField As ParameterFieldDefinition Dim defaultValue As ParameterValues paramField = crReportDocument.DataDefinition.ParameterFields.Item("SexID") discreteParam.Value = txtGender.Text.Trim defaultValue = paramField.DefaultValues defaultValue.Add(discreteParam) paramField.ApplyCurrentValues(defaultValue) paramField = crReportDocument.DataDefinition.ParameterFields.Item("RaceID") discreteParam.Value = txtRace.Text.Trim defaultValue = paramField.DefaultValues defaultValue.Add(discreteParam) paramField.ApplyCurrentValues(defaultValue) paramField = crReportDocument.DataDefinition.ParameterFields.Item("LBirth") discreteParam.Value = lblUpDOB.Text defaultValue = paramField.DefaultValues defaultValue.Add(discreteParam) paramField.ApplyCurrentValues(defaultValue) paramField = crReportDocument.DataDefinition.ParameterFields.Item("UBirth") discreteParam.Value = lblLowDOB.Text defaultValue = paramField.DefaultValues defaultValue.Add(discreteParam) paramField.ApplyCurrentValues(defaultValue) paramField = crReportDocument.DataDefinition.ParameterFields.Item("SiteID") discreteParam.Value = ddlSite.SelectedItem.Value defaultValue = paramField.DefaultValues defaultValue.Add(discreteParam) paramField.ApplyCurrentValues(defaultValue) Dim tDay As Integer Dim tCall As Integer Dim DD As DateTime 'Date that is X amount of days in the past decided by txtPast Dim CallActi

    Visual Basic csharp

  • EXPORT PDF from VB.NET
    P partt

    I talked to the person who made the .rpt file. They told CrystalReports to expect data from the stored procedure I use and they clicked and dragged the field names onto the crystal report sheet from crystal reports' view of that stored procedure. Not sure how clear that was....

    Visual Basic csharp
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups