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
D

DA_Loring

@DA_Loring
About
Posts
44
Topics
14
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Sending manually created datatable to SQL server
    D DA_Loring

    Hi, I have an application that reads data from a text file into a datatable in the format required for a table in an SQL SErver 2005 database. My question is, having filled the table 'manually' in memory, how do I connect that table to the database and insert the information? Obviously I can do inserts for each row in the datatable, but there are around 30,000 rows so I am looking for a faster method as this can take some time. I understand that the dataadapter requires the insert command etc but 1) how do I get the table into the adapter and 2) does it know that these are new records? Any help would be very geatly appreciated.

    David Loring !! Keep Music Live !!

    Visual Basic question database sql-server sysadmin performance

  • Writing data back to a table
    D DA_Loring

    Thanks for the reply. I had just reached that conclusion myself, so your reply confirmed my suspicions. I also normally used stored procs so this one off was a new venture!!

    David Loring !! Keep Music Live !!

    Visual Basic database help announcement

  • Searching a particular text
    D DA_Loring

    If Instr(strYourString,strYourCharacter) > 0 Then End if

    David Loring !! Keep Music Live !!

    Visual Basic algorithms

  • Calculating employee age
    D DA_Loring

    Try putting seperators in the dates, either - or / so you get 02-12-1980 or 02/12/1980

    David Loring !! Keep Music Live !!

    Visual Basic help

  • how to keep a form always active
    D DA_Loring

    Have you tried setting it always on top?

    David Loring !! Keep Music Live !!

    Visual Basic tutorial question

  • Writing data back to a table
    D DA_Loring

    This is probably very simple to answer, and I must be doing something very silly, but I just don't seem to be able to get changes in a dataset to write back to a table in the database. I have used stored procs up 'til now but this is a quick fix needed to join two columns, date and time, into one datetime column, and I just cannot get it to work. Here is the code: Dim dsetData As New DataSet Dim dteTemp1 As Date Dim dteTemp2 As Date Dim intRowCount As Integer = 1 Using sqlcnnData As New SqlConnection(m_strConnect) Dim sqlcmdData As New SqlCommand("SELECT * FROM DDI_tbl_SystemDemandData", sqlcnnData) sqlcmdData.CommandType = CommandType.Text Dim sqldaData As New SqlDataAdapter(sqlcmdData) Dim builder As SqlCommandBuilder = New SqlCommandBuilder(sqldaData) builder.QuotePrefix = "[" builder.QuoteSuffix = "]" sqldaData.Fill(dsetData, "Dates") If dsetData.Tables(0).Rows.Count > 0 Then Dim drowData As DataRow For Each drowData In dsetData.Tables(0).Rows dteTemp1 = DateValue(drowData("DataDateTime")) dteTemp2 = drowData("DataTime") dteTemp1 = dteTemp1.AddHours(Hour(dteTemp2)) If Minute(dteTemp2) > 0 Then dteTemp1 = dteTemp1.AddMinutes(Minute(dteTemp2)) End If drowData("DataDateTime") = dteTemp1 drowData.AcceptChanges() Label1.Text = "Processed row " & intRowCount.ToString Application.DoEvents() intRowCount = intRowCount + 1 Next dsetData.AcceptChanges() intRowCount = intRowCount - 1 Label1.Text = "Completed. Processed " & intRowCount.ToString & " rows" sqldaData.Update(dsetData, "Dates") Else Label1.Text = "FAILED" End If sqldaData.Dispose() sqlcmdData.Dispose() End Using dsetData.Dispose() I don't get any errors, it runs OK, but just does not do it! I any one can point me in the right direction I would be most grateful. David Loring !! Keep Music Live !!

    Visual Basic database help announcement

  • Resetting an identifier
    D DA_Loring

    Does anyone know how I can reset the identifier seed in an sql table back to 1, using vb .net? I have to transfer data from an access database, and I need to clear out the sql server table before the transfer. Thanks

    David Loring !! Keep Music Live !!

    Visual Basic database csharp sql-server sysadmin question

  • VB.net Flexgrid?
    D DA_Loring

    Yes absolutely. It does not have to be connected at all. The only thing I found difficult was getting my head round the way you go about doing this. You can also have columns with combo box drop downs or check boxes. I could try an help you out if you get stuck with some examples, but I don't guarantee that I am doing it the right way! I have worked it out over a period of time, and it works for me. I am away from my email at present so do not be surprised if there is a delay in replying.

    David Loring !! Keep Music Live !!

    Visual Basic csharp question

  • Strange entries in My Doc\user\aplications
    D DA_Loring

    Thanks Dave Maybe they get there when VS2005 crashes, as it has done several times, but they just appear to contain a configuration file the contents o which is: They are all itentical.

    David Loring !! Keep Music Live !!

    Visual Basic csharp question

  • VB.net Flexgrid?
    D DA_Loring

    de silva wrote:

    Is there a flexgrid conrol in vb.net as in vb?if it is not,what should i do to get the same functinality.

    Try the DataGridView. It is similar functionality once you have got your head round how to use it.

    David Loring !! Keep Music Live !!

    Visual Basic csharp question

  • Strange entries in My Doc\user\aplications
    D DA_Loring

    Hi, Can anyone tell me if VB .NET leaves strange entries in My Documents\%USER PROFILE%\Application Data when an item is deleted from a project? CGlobalParameters.dll_Url_4l0fzug125s0wj3wm2qsvdo53iyv2xj5 is the name of a folder that has been created. I did delete the CGlobalParameters.dll from a project. There are several others that all appear to be items or projects I have deleted, but Spyware Detector is saying they are spyware.

    David Loring !! Keep Music Live !!

    Visual Basic csharp question

  • A problem with an array populating an unbound DGV
    D DA_Loring

    Hi Dave, My face is seriously and completely covered in egg!! I apologise for wasting your time as it transpires that the error is actually occuring in the Cell_Enter event and I never saw this because I was stepping over the .add(row) A sad case of not being able to see the wood for the trees!:doh: Too many late nights, cigarettes and much too much coffee. Thanks again and apologies again.

    David Loring !! Keep Music Live !!

    Visual Basic help question database data-structures

  • A problem with an array populating an unbound DGV
    D DA_Loring

    Hi Dave, I don't have a problem with the column headers, but just so you can see, the columns are created thus: dgvData.Columns.Clear() dStartDay = mv_dCurrentAnomDate.AddDays(-2) iStartDayNumber = Weekday(dStartDay) dgvData.Columns.Add("Unit", "UNIT") For iLoopVar = 1 To 15 dgvData.Columns.Add("D" & Format(iLoopVar, "00"), Format(dStartDay, "dd-mm-yyyy") & Chr(10) & Format(dStartDay, "ddd")) dgvData.Columns(iLoopVar).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter dStartDay = dStartDay.AddDays(1) Next dgvData.ColumnHeadersHeight = 45 THe only error message I get is this "Index and length must refer to a location within the string. Parameter name: length" Source: mscorlib To be honest I don't actually understand what the error message is trying to tell me!

    David Loring !! Keep Music Live !!

    Visual Basic help question database data-structures

  • A problem with an array populating an unbound DGV
    D DA_Loring

    THe error message is: "Index and length must refer to a location within the string. Parameter name: length" Source: mscorlib The lines causing the error are: Dim row() As String = {rowBuild(0), rowBuild(1), rowBuild(2), rowBuild(3), rowBuild(4), rowBuild(5), rowBuild(6), rowBuild(7), rowBuild(8), rowBuild(9), rowBuild(10), rowBuild(11), rowBuild(12), rowBuild(13), rowBuild(14), rowBuild(15)} Me.dgvData.Rows.Add(row) This is loading data into an unbound DataGridView. The declaration for rowBuild is Dim rowBuild(15) As String Each rowBuild element has data in it, so I can't see what is wrong. Any ideas????????:confused:

    David Loring !! Keep Music Live !!

    Visual Basic help question database data-structures

  • ADO Persisted Recordset XML
    D DA_Loring

    Thanks very much for your help Dave.

    David Loring !! Keep Music Live !!

    Visual Basic csharp xml question

  • ADO Persisted Recordset XML
    D DA_Loring

    Hi Dave The VB6 project writes the file and the .NET project loads it. I did find .ReadXML but the project is not in a state to run this yet. Would .ReadXML understand the VB6 recordset schema? The code I was thinking to use is dTable.ReadXml(shareParams.OperationalShare & "\" & shareParams.GeneralInputFolder & "\" & dtRow("DataFileName")) Where dTable is a DataTable and the parameter is the file name.

    David Loring !! Keep Music Live !!

    Visual Basic csharp xml question

  • ADO Persisted Recordset XML
    D DA_Loring

    Hi Can anyone tell me if there is a method of loading an ADO persisted recordset XML file (VB6) into a .NET datatable, without installing ADODB in the project?

    David Loring !! Keep Music Live !!

    Visual Basic csharp xml question

  • [Message Deleted]
    D DA_Loring

    I believe your problem is that you are trying to compare two string dates as if they were date values, which of course you cannot do successfully. The only way you can successfully compare 'dates' as strings would be to arrange the dates in yyyymmdd format so that they have a 'numerical' value to which you can apply an operator. I would suggest that the dates be stored in the database as either proper dates, or as the string representation of the date in yyyymmdd format. EIther of these would make it much easier to handle date comparisons. If changing the database structure to a date is not possible at this stage you may have a problem unless you can change the string storage to a more usable format.

    David Loring !! Keep Music Live !!

    Visual Basic

  • Sub Procedures
    D DA_Loring

    Can you be more specific? What are you wanting to know? Your question is far too general!:(

    David Loring !! Keep Music Live !!

    Visual Basic

  • Populate a combobox on a DataGridView control [modified]
    D DA_Loring

    Hi, I am fairly new to VB.net and I am stuck on how to populate the list portion of a combo box that is part of a DataGridView control I have got as far as using the example code on the MS Help, which is for a text box, and changed it to a combo box, and I have prepared a binding source with the data, but I cannot see anything in the properties that lets me attach the binding source to the combo box Private Sub CustomiseUnitsColumn() 'Creates the drop down boxes for the units Dim column As DataGridViewColumn = sggData.Columns("Unit ID") Dim cell As DataGridViewCell = New DataGridViewComboBoxCell column.CellTemplate = cell End Sub Can anyone point me in the right direction?:confused: Er actually the 'cell' thing does not work either. I get the message: System.InvalidCastException was unhandled Message="Value provided for CellTemplate must be of type System.Windows.Forms.DataGridViewTextBoxCell or derive from it." Source="System.Windows.Forms" I am even more confused now!:confused::confused: -- modified at 11:38 Friday 30th March, 2007 -- modified at 11:41 Friday 30th March, 2007

    David Loring !! Keep Music Live !!

    Visual Basic help tutorial csharp wpf
  • Login

  • Don't have an account? Register

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