|
it is working just that it saves the sheets diffrerently as sheet 1 2 and 3 in 3different files instead of sheets 1 2 and 3 in one file .
joe
|
|
|
|
|
Like I said, to solve a problem like that, you'll have to get ahold of whoever wrote PDFill and see if there is something you can do to get it to save everything in one file.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Im new to this language so forgive my lack of knoledge, i am getting an error about the namespace on line 4"Expression expected" and on line 9 Description "Description is a namespace,aned so is not a valid expression"
Imports System.Web.Services
Imports System.Data
<webservice(namespace="http: localhost="" flyright="" ",="" _
description="Flight information service" )=""> _
Public Class FlightService
Inherits System.Web.Services.WebService
<webmethod(description =="" "submit="" the="" flight="" number="" and="" a="" time="" will="" be="" returned")=""> _
Public Function ArrivalTime(ByVal FlightNum As String) As String
Dim theTime As String
Select Case FlightNum
Case 1001
theTime = "12.30 AM EST"
Case 2002
theTime = "4:15 PM EST"
Case Else
theTime = "INVALID FLIGHT NUMBER"
End Select
Return theTime
End Function
|
|
|
|
|
You might want to try posting your code. I don't think it's complete.
When you do, make sure you click the "Do not treat <'s as HTML tags between the message and signature windows.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
its ok it was only the syntax of the code tht was wrong
|
|
|
|
|
HI IAM NEW TO .NET I JUST WANT TO KNOW HOW CAN I CHANGE THE COLOUR OF MSGBOX/INPUTDIALOG BOX FROM ITS DEFAULT COLOUR
THANKS I NEED SOME MORE HELP FROM THIS TEAM
|
|
|
|
|
FIRST OF ALL, STOP YELLING! People are trying to write code around here!
Second, you can't change the colors of the default MessageBox and InputBox. They'll use the system colors no matter what.
If you want this kind of functionality, you'll have to develop your own MessageBox and InputBox classes that expose this functionality. It's not hard at all.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Coding Dogs,
I would like to know that I am programming correctly & responsibly. Would you say that the new version of this function is correct as it concerns allocating and deallocating new objects? Or do I even have to bother with this? a.k.a. Can I just rely on the .NET environment to handle memory management once a DIM goes out of scope?
I am a C# programmer and I feel like the NEW VERSION is correct, but I am not sure. Also, I did not like variables declared on the fly.
Thank you in advance for any opinions.
William-SD
'NEW VERSION'
Public Shared Function GetData(ByRef SQL As String) As System.Data.DataSet
Dim cn As System.Data.SqlClient.SqlConnection
Dim adp As System.Data.SqlClient.SqlDataAdapter
Dim ds As System.Data.DataSet = New System.Data.DataSet
Try
cn = New System.Data.SqlClient.SqlConnection(ConnectionString)
If Not (cn.State = ConnectionState.Open) Then
Throw New System.Exception("Database connection failed")
End If
adp = New System.Data.SqlClient.SqlDataAdapter(SQL, cn)
If (Len(SQL) > 0) Then
cn.Open()
adp.Fill(ds)
GetData = ds
Else
ds.Dispose()
ds = Nothing
GetData = New System.Data.DataSet 'return nothing in an empty dataset
End If
Catch
ds.Dispose()
ds = Nothing
GetData = New System.Data.DataSet 'return nothing in an empty dataset
Finally
cn.Close()
adp.Dispose()
cn.Dispose()
adp = Nothing
cn = Nothing
End Try
End Function
'OLD VERSION'
Public Function GetData(ByRef SQL As String, ByRef ConnectionString As String) As System.Data.DataSet
Dim ds As System.Data.DataSet = New System.Data.DataSet
If (Len(SQL) > 0) Then
Dim cn As System.Data.SqlClient.SqlConnection = Connect(ConnectionString)
Try
Dim cmd As SqlClient.SqlCommand = cn.CreateCommand()
cmd.CommandText = SQL
cmd.CommandType = CommandType.Text
Dim adp As System.Data.SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(cmd)
adp.Fill(ds)
Finally
cn.Close()
End Try
End If
GetData = ds
End Function
|
|
|
|
|
I'm not sure which way is necessarily better but in both of your finally clauses, if cn fails to be allocated or open for some reason and is nothing then you will get an exception when you do cn.Close(). I've made this same mistake a few times and usually i just fix it like this:
<br />
If Not cn Is Nothing Then cn.Close()<br />
- Tom
|
|
|
|
|
The dispose methods does that for you. Simple call cn.Dispose() in your finally.
|
|
|
|
|
i think cn.dispose() is better
|
|
|
|
|
I would write it like this:
If you need an explaination on any reason why I did certain things, just let me know.
Public Shared Function GetData(ByRef SQL As String) As System.Data.DataSet
Dim cn As New System.Data.SqlClient.SqlConnection(ConnectionString)
Dim adp As New System.Data.SqlClient.SqlDataAdapter(SQL, cn)
Dim ds As New System.Data.DataSet
Try
If SQL.Length > 0 Then
cn.Open()
adp.Fill(ds)
End If
Finally
adp.Dispose()
cn.Dispose()
End Try
Return ds
End Function
|
|
|
|
|
Does Dispose() work if the variable is never initialized?
Example:
Dim MyObject As Object
MyObject.Dispose()
I suppose I could test it quick but does that throw an exception because of a null object reference?
Edit:
Ok tested with following code
Dim oObject As New Object
oObject = Nothing
oObject.Dispose()
Which threw a NullReferenceException. This is why I was wondering if it was safe to just put cn.Dispose() in the finally clause instead of enclosing it in If Not cn Is Nothing Then block. That way you are covered if for some reason it never got initialized. Unless I'm missing something.
|
|
|
|
|
Don't worry about the whatever = Nothing . Just call the .Dispose() method on it. As soon as the object goes out of scope, the reference is automatically dropped and the GC collects it, when it gets around to it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I realize you don't have to set an object reference to nothing. That wasn't my point. The point was you can't call .Dispose() on an NullReference. So if for some reason the object never gets assigned a reference (say there is a memory allocation problem for some reason) then in the finally clause the program would crash if there is a object.dispose() statement.
|
|
|
|
|
There is no NullReference Exception in my example, I declare the variables as new at the top of the sub.
If there's a memory allocation problem at some point that prevents the variable from being initialized, then the user has way more problems than your app crashing
|
|
|
|
|
I am copying data from excel file to spreadsheet component in VB6 form.The problem is that the the orientation of text is not maintained while copying and I am not able to find any method to copy the format of the cell to the component
|
|
|
|
|
What component? It's entirely possible that the component doesn't support the formatting Excel uses.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Microsoft Office Web Component.I read somewhere that it usually supports all excel features that is why I was wondering for the above mentioned possibility
|
|
|
|
|
I have no idea if it'll do what you what. I've never used it.
But, from what I've read, I don't think it'll support copy and paste how you want.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am display a data grid and have enclosed some code below.
How do I get the column width and other properties. Seem get readonly but I want column width, alignment etc as well.
Any ideas?
Dim dtTable As DataTable = New DataTable
Dim drDataRow As DataRow
Dim col1 As New DataColumn
col1.DataType = System.Type.GetType("System.Int32")
col1.ColumnName = "Test"
col1.ReadOnly = True
dtTable.Columns.Add(col1)
|
|
|
|
|
|
I have a datagrid but nothing is getting displayed on it. Here is the sample code. What am I doing wrong.
Private Sub setFloorAreaGridStyles()
'Apply custom formatting
Dim dgTableStyle As New DataGridTableStyle
Dim aCol1 As New DataGridTextBoxColumn
With aCol1
.HeaderText = "ID##"
.Width = 100
.TextBox.Enabled = False
.NullText = ""
End With
With dgTableStyle.GridColumnStyles
.Add(aCol1)
End With
DataGrid1.TableStyles.Add(dgTableStyle)
Exit Sub
End Sub
|
|
|
|
|
I think you are missing one thing
acol1.MappingName = "name of the field in datatable binding with the grid"
Give that name and you will see the data displayed. Let me know if there is still any probs regarding that.
Het Waghela
Be Humble in Victory and Strong in Defeat.
Het Waghela, Blog|Het Waghela DotNet Questions Link|More Links
|
|
|
|
|
Still seem to be getting a problem. It will properly be something simple or setting I have missed. Here is an example of some code. I have copied it from the Microsoft site.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'FormatDataGrid
AddDataGridTableStyle()
End Sub
Private Sub AddDataGridTableStyle()
' Create a new DataGridTableStyle and set MappingName.
Dim myGridStyle As DataGridTableStyle = _
New DataGridTableStyle
myGridStyle.MappingName = "Customers"
' Add two DataGridColumnStyle objects.
Dim colStyle1 As DataGridColumnStyle = _
New DataGridTextBoxColumn
colStyle1.MappingName = "firstName"
Dim colStyle2 As DataGridColumnStyle = _
New DataGridBoolColumn
colStyle2.MappingName = "Current"
' Add column styles to table style.
myGridStyle.GridColumnStyles.Add(colStyle1)
myGridStyle.GridColumnStyles.Add(colStyle2)
' Add the grid style to the GridStylesCollection.
DataGrid1.TableStyles.Add(myGridStyle)
End Sub
|
|
|
|