|
Apology accepted. Thing is, it IS as simple as your hip shot. The Grid DOES affect the datasource and visa versa.
The dataset.acceptchanges statement just before the dataAdapter.updatedataset part appears to be the stoolsample in the applepie. It changes all rowstates from deleted, added to unchanged. Which in turn must be telling the adapter that nothing happened.
Took out ds.acceptchanges and problem solved.
|
|
|
|
|
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
hi der,
If possible could someone please solve this problem of mine. I am a beginner and want to get my results in Excel format but the output which i need has to be formatted and i am not able to get that kinda format. Have already developed the application with backend in Access and need to get the data frm Access and display it in Excel. Have already incorp. Crystal reports and have put the export tab on it. but what i need is an Excel format. If anybody can do it please mail me i can send u the Excel file in the format which i want.
|
|
|
|
|
The whole answer, in a nutshell, is to control Excel directly through VB. First, add a reference to the Excel Library through Project...References.
Then, you can do things like the following:
Private Sub cmdStart_Click()
Dim xl As New Excel.Application
Dim myWorkBook As Excel.Workbook
Dim myWorkSheet As Excel.Worksheet
xl.Workbooks.Open "c:\000\Book1.xls"
Set myWorkBook = xl.ActiveWorkbook
Set myWorkSheet = myWorkBook.ActiveSheet
With myWorkSheet.Range("Headers")
With .Borders.Item(xlEdgeBottom)
.Weight = XlBorderWeight.xlThin
.LineStyle = XlLineStyle.xlContinuous
End With
.Font.Italic = True
End With
Dim intRow As Integer
Dim intTop As Integer
intTop = 3
For intRow = 1 To myWorkSheet.Range("Data").Rows.Count
Dim intRowOffset As Integer
intRowOffset = intRow + intTop
myWorkSheet.Cells(intRowOffset, 2).Font.Bold = True
myWorkSheet.Cells(intRowOffset, 2).Value = 5
Next
myWorkBook.Save
myWorkBook.Close
End Sub
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
In order to enter values in the sample Excel sheet you sent over, I'd do one of three things:
1) Hard-code the cell addresses of the locations in the spreadsheet where you intend to place values, i.e., myWorkSheet.Range("B6").Value = rsTable("field").Value
2) Define each location in the template where you intend to store a value as a named range, then: myWorkSheet.Range("CashCollectionValueOne").Value = rsTable("field").Value
3) Store the relative addresses of each location in the formatted sheet in a cross-reference table, then lookup the location of a value in the cross-reference.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
I am trying to figure out a couple of things, and could use some help. I've got a project (VB.NET) that calculates loan payments and need to modify it so that it will calculate and display a full amortization schedule, using an array.
#1: Has anyone done this, and have a working for/next/loop (or something else) that you might share?
#2: What control would be most appropriate for displaying the results? I'm thinking that a DataGrid would look good and provide nice scrolling functionality, etc., but I don't know how to bind a DataGrid to an array.
========
Stewart
|
|
|
|
|
Insted of using DataGrid, try using FlexGrid.
Yogendra Agarwal
Telemune Software Solutions Pvt. Ltd.
Mobile: +91 9818899010
|
|
|
|
|
dear all,
how do i split a Null delimited string Buffer which is returned by an api function.
rIsHaBh
|
|
|
|
|
assuming strBuffer is returned by the API
Dim v As Object
v = Split(strBuffer, ControlChars.NullChar)
1fm1fu
|
|
|
|
|
Thanx for your reply but this is not working
steff kamush wrote:
v = Split(strBuffer, ControlChars.NullChar)
instead if i use
v = Split(strBuffer, Chr(0))</
then it works absolutely fine.
Thanx anyways.
rIsHaBh
|
|
|
|
|
Kool. Guess u r using VB6, not .net, no? Mine was meant 4 .net
1fm1fu
|
|
|
|
|
Ohh....tht was the problem. I tried tht code on VB6.
Thanx a lot
rIsHaBh
|
|
|
|
|
How can i get the domain names & workgroups separately in a network usin vb.net?Plzz replyyyy
|
|
|
|
|
Look up the System.DirectoryServices namespace on MSDN, and check for examples here on CP for the same thing.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
I used the same class n namespace n passed WinNT: as the query but it lists all the domains n workgroups together.I need those separately.Also I want to get the machines in the workgroup.Whats the query that I should pass.Plzzz replllyyyyy
|
|
|
|
|
I think the key is to enumerate the Properties collection of each child node in the collection of DirectoryEntry children. While there may be a more elegant way of doing so, the way that I was able to get a list of users, for example, was to do something like this:
Dim entry As New DirectoryServices.DirectoryEntry
For Each child As DirectoryServices.DirectoryEntry In entry.Children
Dim propertyValue As Integer = 0
Try
propertyValue = CType(child.Properties("UserFlags").Value, Integer)
Catch ex As Exception
' if it throws an exception, it's not a user item
propertyValue = 0
End Try
If (propertyValue = 513) Then
Console.WriteLine(child.Name)
End If
Next
If you look at the property names in the Properties collection, you should be able to isolate which ones are Domains, which ones are workgroups and which ones are users, etc. I believe there may be a more elegant solution, but I haven't found the best reference for that solution yet.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
Hi,
I'm doing immediate syntax check for VBScript code sentence.
How can i get VBScript compiler error information, such as "expected expression"?
Thank you!
Alan
|
|
|
|
|
Although I'm not entirely sure what your asking, the whole enchilada can be found here[^]
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
the windows task manager application tab shows the application name as wellas the icon associated to that application/process.
i was making a listup of the applications that were running [task manager clone]
this i did by using the enumWindows API along with checks on the style sof the window handles obtained
and it is working
however dunno how to display the icon associated with a process.
any advice!!
|
|
|
|
|
Hello,
This is not to sound stupid, but can anyone please clarify the meaning of ADO.NET in the context of Visual Basic.NET. Please give a simple illustrative example on how ADO.NET work with VB.NET.
Cheers
|
|
|
|
|
Once upon a time, Microsoft created a standard set of API's that allowed programmers to access SQL and ODBC databases through a common programming interface. Since Microsoft's flagship technology at the time was known as ActiveX, they called it Active Data Objects, or ADO.
When they decided to create a whole framework for developers to extend or implement in their code (.NET), they updated the acronym to comply with the new framework terminology, so they called it ADO.NET.
MSDN: ADO.NET provides consistent access to data sources such as Microsoft SQL Server, as well as data sources exposed through OLE DB and XML. Data-sharing consumer applications can use ADO.NET to connect to these data sources and retrieve, manipulate, and update data.
In VB.NET, this means that you can use the classes in System.Data (SqlClient and OleDb and their children) to access data stored in databases.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
Dear Colleagues,
Could anyone help me with a code to display next to the files in the File list, the date and time each file was created. I have made a form that uses the Drive, Directory, and FileList Controls to display a list of files that are contained in a chosen directory within a selected drive. All other bits are functioning well, except the part that I have mentioned above.
All your contributions will be welcome.
Thank you
Ben
|
|
|
|
|
use the FileInfo method provided in the system.IO class. copy and paste the following code into a new project, test it out, and edit.
edit: oh ya, this is for a console application.
Imports System.IO
Module Module1
Sub Main()
Dim myFileName As String = "C:\file.txt"
Dim myFileInfo As New FileInfo(myFileName)
'print time created on 24 hour scale
Console.WriteLine( _
myFileInfo.CreationTime.Hour _
& ":" _
& myFileInfo.CreationTime.Minute _
& ":" _
& myFileInfo.CreationTime.Second)
'print the date created in YYYY/M/D form
Console.WriteLine( _
myFileInfo.CreationTime.Year _
& "/" _
& myFileInfo.CreationTime.Month _
& "/" _
& myFileInfo.CreationTime.Day)
Console.ReadLine()
End Sub
End Module
------------------------
Jordan.
III
|
|
|
|
|
I am trying to add a border to the bottom of a range in Excel. It is easy to add a border on all four sides using the BordersAround Method, but I can't figure out how to add a border to the bottom of the cell only.
Can any one tell me how to do this?
Thanks!
nvmoss
|
|
|
|
|
Of course, you already know about adding the Excel library as a reference to your project. After that, adding a border should be easy:
Dim xl As New Excel.Application
xl.Workbooks.Open("c:\000\book1.xls")
With xl.Range("Data").Borders(Excel.XlBordersIndex.xlEdgeBottom)
.LineStyle = Excel.XlLineStyle.xlContinuous
.Weight = Excel.XlBorderWeight.xlThin
.ColorIndex = Excel.XlColorIndex.xlColorIndexAutomatic
End With
xl.ActiveWorkbook.Save()
xl.Workbooks.Close()
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|