|
here is the xml again,
the forum reads it as HTML tags:
?xml version="1.0" encoding="ISO-8859-1"?>
CatalogRequest xml:lang="en-US">
XMLPassword>myxmlpassword
LastUpdated>2005-09-21 06:00:00
/CatalogRequest>
Sam
|
|
|
|
|
There's no way we are going to give you the code for this. You have apparently made no attempt at solving it yourself. This forum is for help with programming problems - not doing your assignments for you.
If you need help with one or two problems related to the assignment then that's fine - we're only too happy to help - but we won't do it for you.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Steve yes i tried working on it but i have had no clue what is that or how it does work, im programer and i know well about coding and trying.
anyway i got to do it with a help from a friend in php thanks
Samer
Samer
|
|
|
|
|
In the present code, we use a datagrid as a container to print data from a SQL database. The following gets data (via ODBC) in the SQL database and save it in a DATASET.
Public Function GetDatasetGiveSql(ByVal sqlCmd As String) As DataSet
Dim dataset As New DataSet
odbcCmd.Connection.Close()
odbcCmd = New Odbc.OdbcCommand(sqlCmd, odbcConnection)
odbcAdapt = New Odbc.OdbcDataAdapter(odbcCmd)
odbcCmd.Connection.Open()
odbcAdapt.Fill(dataset)
Return dataset
End Function
Elsewhere in the software, the software builds a query and sends it to the database like this:
dsCommand = sql.GetDatasetGiveSql(cmd)
DataGridCommand.SetDataBinding(dsCommand, "Table")
As you can suspect, dsCommand is a DataSet and DataGridCommand is the DataGrid to update.
Easy to date… OK.
Question:
---------
I want to have control on the background and foreground color of a cell based on some information like any people in this forum. I found many EXAMPLES with DataGridColumnStyle where the idea is to override the Paint method (aka: make a custom datagrid control). Yes, Perfect. I understand it BUT in this case… I DON’T CONTROL ANY COLUMN in the datagrid. It seems that the SetDataBinding() does everything by itself, it is magic.
I did not find HOW to OVERRIDE the Paint() method of this datagrid. Maybe I don’t understand something !
Danny Gilbert, enginneer
Montréal, Canada
Danny Gilbert, enginneer
Montréal, Canada
|
|
|
|
|
Hi Danny
I found a class on the net that changes the cell color according to what
information is placed in the cell, is this what your after? Below is how
I used it. Instead of a basic color I actually used a linear graded color in the cell, looks great in the grid.
Imports Microsoft.VisualBasic
Imports System
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms
Public Class DataGridColoredTextBoxColumn
Inherits DataGridTextBoxColumn
Public Sub New()
'Warning: Implementation not found
End Sub
Protected Overloads Overrides Sub Paint(ByVal g As Graphics, ByVal bounds As Rectangle, ByVal source As CurrencyManager, ByVal rowNum As Integer, ByVal backBrush As Brush, ByVal foreBrush As Brush, ByVal alignToRight As Boolean)
' the idea is to conditionally set the foreBrush and/or backbrush
' depending upon some crireria on the cell value
' Here,we color anything that matches the select case
Try
Dim o As Object
o = Me.GetColumnValueAtRow(source, rowNum)
If (Not (o) Is Nothing) Then
Dim c As Char
Dim cellStr As String
c = CType(o, String).Substring(0, 1)
cellStr = CType(o, String)
Select Case cellStr
Case "**CRITICAL**"
backBrush = New LinearGradientBrush(bounds, Color.FromArgb(255, 50, 25), Color.FromArgb(128, 20, 20), LinearGradientMode.BackwardDiagonal)
foreBrush = New SolidBrush(Color.White)
Case "- URGENT -"
backBrush = New LinearGradientBrush(bounds, Color.FromArgb(255, 255, 255, 0), Color.FromArgb(200, 10, 0), LinearGradientMode.BackwardDiagonal)
foreBrush = New SolidBrush(Color.White)
Case "current"
backBrush = New LinearGradientBrush(bounds, Color.FromArgb(255, 10, 255, 0), Color.FromArgb(0, 50, 0), LinearGradientMode.BackwardDiagonal)
foreBrush = New SolidBrush(Color.White)
End Select
End If
Catch ex As Exception
' empty catch
Finally
' make sure the base class gets called to do the drawing with
' the possibly changed brushes
MyBase.Paint(g, bounds, source, rowNum, backBrush, foreBrush, alignToRight)
End Try
End Sub
End Class
It gets called like this.
Dim numCols As Integer
numCols = Me.m_openQueries.Tables(0).Columns.Count
Dim aColumnTextColumn As DataGridColoredTextBoxColumn
Dim i As Integer
i = 0
Do While (i < numCols)
aColumnTextColumn = New DataGridColoredTextBoxColumn()
aColumnTextColumn.HeaderText = m_openQueries.Tables(0).Columns (i).ColumnName
aColumnTextColumn.MappingName = m_openQueries.Tables(0).Columns(i).ColumnName
table_style.GridColumnStyles.Add(aColumnTextColumn)
i = (i + 1)
Loop
Hope this helps
cowtech
|
|
|
|
|
Thank you very much, I will try it.
Danny Gilbert, enginneer
Montréal, Canada
|
|
|
|
|
Hi Danny
Just wondering how you went with this.
cowtech
Sydney Australia
|
|
|
|
|
I have an MDIList menu item that I want to enumerate at run-time and possibly change the text shown for some of the MDI children included in that list. When I enumerate the collection for that menu item, none of the open MDI child windows show in the list although they are clearly there in the actual drop-down of the menu item. Does anyone know how I can enumerate the menu item that contains the MDIList at run-time and change the text associated with some of the MDI children in that list?
Thank you.
|
|
|
|
|
I have a ActiveX control created in VB 6 from a 3rd party and wanted to use it in ASP.Net/VB.Net but the control dosent expose APIs which could be called from ASp.Net/VB.Net. I tried invoking the function from javascript but later foudn that some functions on the OCX were not even exposed to javascript. So the tech support (who do not provide support for .Net) suggested that we create another wrapped OCX around theirs, and use that OCX within our web pages. So far so good.
We did as they said, created our own OCX, doing whatever we wanted to. We then tested it out on .Net 1.1 and the control worked like a charm. But when we attemp to use the same control in VS 2005 (prfessional edition), the control does appear in teh toolbox pane, but is disabled, and does not allow itself to be placed on any page. in VS 2003 we are using it normally without any issues.
Can you plz guide me as to what might be the problem.
|
|
|
|
|
Hi.
Can anyone help me with the problem I have. I need to write a program that will monitor user activity: file open, deleted, renamed, on the server. But most important I need to know WHO actually did it (user name).
I was able to write code (windows service), using FileSystemWatcher, that can monitor directories on my computer and even was able to parse it by extensions.
The problem is I cannot get user name who changed, deleted, created files. As soon as I install my windows service it returns SYSTEM as user name for me.
I looked for other programs but they can't give me user name as well. Like
http://www.sysinternals.com/Utilities/Filemon.html[^]
Did anyone have any experience with this? Any suggestions are appreciated.
Thank you,
|
|
|
|
|
About the only other place to try to get this information would the Network Redirector. But I don't think you'll be able to match it up to any actual file operation in the File System. You can see who has what files open, but not what those users are doing to them using the Win32 API NetFileEnum.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks Dave.
Do you have any references (link or article) I can read?
I'm not sure what should I do. I thought file system suppose to have last modified information somewhere (who opened file last).
Should I still use FileStreamWatcher with combination of Win32 API (NetFileEnum)?
Thanks,
|
|
|
|
|
It doesn't. It tracks the last owner of the file, which is not necessarily the last person to touch it. It also tracks the last Modified time, last Accessed time, and Created time, but that's about it.
You can try FileSYstemWatcher and the NetFileEnum, but keeping the two in synch would probably be very difficult. For instance, two people have the same file open, but only one writes to it. Which one??? There's no way to tell...
Dave Kreskowiak
Microsoft MVP - Visual Basic
-- modified at 13:34 Wednesday 19th April, 2006
|
|
|
|
|
Thanks for your help Dave. I think I will use FileSystemWatcher with Event Log entries (parse Event Log) like this I can tell at lest who access it and match it against FileSystemWatcher (create, delete, modify). I will write 2 services (I think it would be better if I keep these separate) to monitor dirctory and Event Log.
Thank you again.
|
|
|
|
|
Hi
I want to create a report in crystal reports (the one that comes with VS 2003) that reads its data from our SQL2000 server. The problem I have, is that it keeps on poping up the database login screen every time I try to run the report and then I have to enter the password. How do I remove the database login popup?
Some extra information:
1. I have created a user in SQL Server 2000 with a password and the correct access rights to the tables that I want to read from.
2. In Crystal reports I created a connection with OLE DB (ADO) and entered the server, user ID, password and default database. Integrated security is not selected.
Anyone have an idea what the problem might be?
Thanks!
Izak
|
|
|
|
|
Hi all,
I'm developing a vb.net 2005 application with an Access database. I create a setup and install it on a client machine. The first time I run the application it takes about 20 seconds to load. If I close it down and run it again straight away it takes about 3-4 seconds to load. If I don't load it for about an hour or restart the machine it again takes 20 seconds to load.
I then put in a few thousand records and the times are about the same so I don't think it has to do with the database.
The machines I've tried it on are about 3 years old. Is it something I have to live with or is there something I can do.
In AdvancedCompile Options I have Enable Optimizations turned on. Should I have Configuration Manager set to Release instead of Debug everytime I create a setup or does VS 2005 automatically do it?
Any help would be much appreciated,
|
|
|
|
|
Well, the slow startup time first time is because of what is called a "Cold Startup". So, if you are running 2 or 3 .NET applications at the same time, the 20+secs delay will be only for the first app. This is because the OS loads the .NET Libarrys and JITter into Memory the first time a .NET app is loaded.
Probably, this problem will be solved in Vista, since probably the .NET Framework will be preloaded on startup....
More Information here : http://msdn.microsoft.com/msdnmag/issues/06/02/CLRInsideOut/default.aspx
Yuvi Panda T
Microsoft Student Partner
Blogs at : http://yuvipanda.blogspot.com
|
|
|
|
|
Thanks for that Yuvi,
I tried a small hello world app. Re-started the machine and it took about 10 seconds to load, so you are correct with your Cold Startup theory.
Thanks for clearing that up for me.
Dave
|
|
|
|
|
hi
I want to have a variabel member in a class in vb6 to be SHARED between all instances of the class. I used Public Shared Myvar as Integer but VB6 automatically changed it to Public Myval as Integer
This is the case for Private Shared... and I could not also use Shared alone to declare the variable.
What can I do to have shared Variables??
-- modified at 10:02 Wednesday 19th April, 2006
|
|
|
|
|
IIRC, there's no such thing in VB6 because VB6 doesn't support true OOP. About the only approximation is to delcare a public variable in a module, but the variable will be exposed to everything, not just every instance of a class.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
"Shared" is a new keyword introduced in VB.NET.
Try using "Static" instead. VB6 classes have serious limitations, so cross your fingers.
|
|
|
|
|
Yes, I know the usage of Shared in VB.NET, but as far as this keyword existed in QBasic (long time ago!) I thought it might be used in vb6 (which was not very wrong, because vb6 IDE recognized it and removed it...)
But if it is the case that Dave mentioned, and I cannot expect such behavior from vb6, I guess I should do the Public Member in a module method...
Thanks anyway....
|
|
|
|
|
MohammadAmiry wrote: this keyword existed in QBasic
My mistake then.
Wow, it's been over 10 years since I've used QuickBasic. I can barely remember it now.
MohammadAmiry wrote: But if it is the case that Dave mentioned, and I cannot expect such behavior from vb6, I guess I should do the Public Member in a module method.
I just tried placing a Static variable inside of a VB6 class method. That way we can have it return a static object reference to a variable container. Unfortunately, it's not static between object instances.
Bummer! It looks like you have to use a Module.
|
|
|
|
|
Hi,
This is kiran
Like I four textboxes in my vb.net application and i want to display textbox controls data in tabular form in word document
plz any one help me
kiran
mailme@ vk_ravula@yahoo.com
|
|
|
|
|
can any one tell me the code at button_click event to trasfer data fro datagrid to excel sheet
mail at toneeraj.kumar@rediffmail.com
thankyou
neeraj kumar
|
|
|
|
|