|
Hello everyone,
I have a little question. I have a datagridview with an unbound column, and some other columns inserted from a datatable as the datasource for the grid.
My problem is, the unbound column is always shown as the first column on the left. I need that column to be the last on the right. any idea on how to do this?
thanks in advance for your help!
~~~ From Milano to The Hague, easy as it goes ~~~
|
|
|
|
|
You can set the order of DataGridView Columns using the DisplayIndex property.
DataGridViewName.Columns("ColumnName").DisplayIndex = X
|
|
|
|
|
Hi
I'd like to change the original form caption contextmenu, for example, to disenable the "Close" menuitem and add my "Cancel". Does anybody know how to make that? Thanks.
David
|
|
|
|
|
Will, I've never had a reason to do it myself, but this[^] is where you start.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Could you please solve the issue for me ?
Requirements:
I have several form midchildren (Please note they are midchild forms). Each has formborderstyle.sizableToolwindow -on every form caption, there is a systemmenu Cancel button.
Now click the Cancel button, the form is closed/disposed. Instead of to close the form, my purpose is to hide it or activate an event when click the button.
Do your guys have any advice? Thanks.
abc
|
|
|
|
|
Private WithEvents _oChildForm As New System.Windows.Forms.Form
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
_oChildForm = New System.Windows.Forms.Form
With _oChildForm
.FormBorderStyle = FormBorderStyle.Sizable
.Text = "ChildForm"
.MdiParent = Me
End With
_oChildForm.Show()
End Sub
Protected Sub _oChildForm_Cancel(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles _oChildForm.Closing
_oChildForm.Hide()
End Sub
abc
|
|
|
|
|
With all the new deatils, this question now has absolutely nothing to do with your original post. I'll refer you to the top post in all the programming forums for an explanation...
You can't change the behavior of that little X. Period. End of story.
No matter what, you're MDIChild form is going to get a FormClosing event. Sooooo, just handle that event, call Me.Hide or whatever you want the form to do, then set the Cancel property of the FormCloseEventArgs to True to cancel closing the form.
Now, you've introduced a problem. When you go to close your application, the child forms will force your app to stay open! Your parent form has to expose a flag to signal these child forms that the the application is closing. Your little Closing event handlers in the child forms must check this flag to see if they really should close and not hide themselves!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
is there a way to know the number of tables in an sql database without opening sql enterprise manager/configuration? using vb.net 2005 application a simple codes/explanation will help thanks...
-- modified at 4:04 Monday 3rd July, 2006
|
|
|
|
|
You can find this information from sysobjects table. All the user defined table having the type 'U'
So writing a query like this will give u number of tables in a database
select count(*) from sysobjects where type = 'U'
NOTE :- Check for the table named "dtProperties", it is a system defined table but type is "U" only (so whatever the count comes COUNT-1 will give u exact number), no idea why, if anyone know about this then please clear my doubt regarding this table.
|
|
|
|
|
thanks this will help... ill try this one....
thank you again...
|
|
|
|
|
I don't know how to wirte Boostrapper in vb.net check DotNetFramework is installed in Client machine
................
-- modified at 4:01 Monday 3rd July, 2006
|
|
|
|
|
Bootstrapper?? For what? What is this app supposed to be doing?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Bootstrapper for dot net framework? I 1 2 check machine is installed it or not, if not install
................
|
|
|
|
|
Socheat.Net wrote: I 1 2 check machine
Enough with the SMS speak. You have a full keyboard in front of you - use it!
I take it you're looking to see if the .NET Framework is installed before your .MSI is launched for installation. You can't write this in VB.NET, or C#, or any other Managed Language. If the .NET Framework isn't installed, how is your code to check for the presence of it going to execute??
There are a bunch of examples out there on how to do this, in unmanaged languages - even prewritten packages. All you have to do is either search the articles here for "bootstrap" or Google for ".NET Framework install bootstrap".
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: the articles here for "bootstrap" or Google for ".NET Framework install bootstrap".
Where?
|
|
|
|
|
Roath Kanel wrote: Where?
You're joking, right?
You've never seen the search box directly under Bob? The little green CP alien at the top of the screen?
And don't you dare tell me you don't know what Google is!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: You're joking, right?
No I'm not.
Dave Kreskowiak wrote: You've never seen the search box directly under Bob?
No I haven't.
Dave Kreskowiak wrote: The little green CP alien at the top of the screen?
Where?
Dave Kreskowiak wrote: And don't you dare tell me you don't know what Google is!
Yes I know google.
|
|
|
|
|
Roath Kanel wrote: Dave Kreskowiak wrote:
The little green CP alien at the top of the screen?
Where?
Directly under the little green alien at the top of The CodeProject web page!!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Ok, I see what you mean now. You mean the search text box under the code project title. We are in the problem of miss cummunication.
|
|
|
|
|
Socheat, you do not need to write your donw bootstrapper. Try to check Microsoft Download Center[^] then download it. But work only for vs.net 2003.
|
|
|
|
|
Hi,
I am developing crystal report in VB.NET. While i printing the report directly "Logon failed" Occurs. How to over come this.
Below the code i used in the project.
Dim Reportviewer As New frmReportviewer
Dim PrinttoKitchen As New crptPrinttokitchen
Str_Query = "{View_HeaderFooterRecord.fd_bill_id} = " & Int_OrderBillID
PrinttoKitchen.RecordSelectionFormula = Str_Query
Reportviewer.repnam = PrinttoKitchen
'Reportviewer.Show()
PrinttoKitchen.PrintOptions.PrinterName = PrinterName
PrinttoKitchen.PrintToPrinter(1, False, 0, 0)
Thank's in advance,
Senthil V.
|
|
|
|
|
hi,
how to update the table and dataset which has no primarykey.my table is in Informix.and use the ODBC connection.
|
|
|
|
|
Using the DataAdapter and TableAdapers, you can't. They require keys on the tables you use them with.
Either you'll have to add keys to your tables, which is highly recommended, or you'll have to write your own procedures for udating records using fields that can uniquely identify each record.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi! All
I have a problem when I tried to upload file by using system.IO Inputsteam my code is following
Dim UploadedFile As HttpPostedFile = FileUpload1.PostedFile
Dim binFileData As Byte()
ReDim binFileData(UploadedFile.ContentLength)
UploadedFile.InputStream.Read(binFileData, 0, UploadedFile.ContentLength)
Dim strConn As String = "Server=[servername];Database=[dbname];UID=sa;PWD=sa;"
Dim connection As SqlConnection = New SqlConnection(strConn)
Dim str1 As String = "Update DocumentImage set DocImage = @CVData where DocumentID=122"
Dim command As SqlCommand = New SqlCommand(str1, connection)
Dim param1 As SqlParameter = New SqlParameter("@CVData", SqlDbType.Image)
param1.Value = binData
command.Parameters.Add(param1)
connection.Open()
Dim numRowsAffected As Integer = command.ExecuteNonQuery()
connection.Close()
It said Cannot access a closed file. on codeline
UploadedFile.InputStream.Read(binFileData, 0, UploadedFile.ContentLength)
The contentLength was 292836 and the ContentType was "application/pdf"
and I have already put the config into web.config
<httpruntime
="" executiontimeout="1200" maxrequestlength="1000000" usefullyqualifiedredirecturl="false" minfreethreads="8" minlocalrequestfreethreads="4" apprequestqueuelimit="100">
But it didn't work fine
Is there somebody who know how to solve the problem this?
thank you in advance
Jibcht
-- modified at 23:23 Sunday 2nd July, 2006
|
|
|
|
|
I'm receiving an error when attempting to use an Oracle stored procedure in a VB .NET 2005 application; the database is Oracle 9.2. The error is ORA-06550 wrong number or types of arguments in call to <sproc name="">. I'm making the call with an Oracle DataReader. The sproc is pretty simple - selecting two columns from a database table, it doesn't even have a WHERE clause.
I've Googled the error and seen that other people have come across the error but I haven't seen any solutions to the problem.
Any help / suggestions would be appreciated.
|
|
|
|