|
Then I have to write 15 or more new delegates? Right?
The aim was to add a toolstrip to the existing menustrip to act like a buddy.
The new toolstrips get all properties from the existing menustrips and share the same events (there are more than 1 menustrip in the mdi).
So I thought I could put some code-lines into a loop....
|
|
|
|
|
If I understand what you're trying to do (bear with me, I'm slow today!), then wouldn't it be easier to add a general event handler to the buddy strip buttons that calls PerformClick on the appropriate menu buttons? You could maintain context via either the Tag property or a dictionary.
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
That would be a very good solution. I'll try it out.
Thanks
Chris
|
|
|
|
|
Hi
Don't think this is VB.NET but... How do I loop thru each non-empty row in Excel VBA?
<br />
For Each oSheet In Worksheets<br />
For Each oRw In oSheet.Rows<br />
IsRowEmpty(oRw) ' Do I need to code IsRowEmpty?<br />
Next oRw<br />
Next oSheet
Thanks
devy
|
|
|
|
|
devvvy wrote: IsRowEmpty(oRw) ' Do I need to code IsRowEmpty?
Yes, because "empty" can have any number of meanings. Does empty mean that there are no values?, no formulas?, no formatting?, ... You have to code this to test to see if the row meets your specification of "empty".
|
|
|
|
|
Okay you are right. But then comes another technical problem...
say I selected three rows on worksheet.
Worksheets("Data").ActiveCell.Row only gives you ONE of the three selected rows.
How do I retrieves all three selected rows?
Thanks!
devy
|
|
|
|
|
Just found solution thanks anyway:
<br />
Dim rngActive As Excel.Range<br />
Set rngActive = Selection<br />
For Each oRecord In rngActive.Rows<br />
... do something ...<br />
Next oRecord<br />
devy
|
|
|
|
|
how to i save time n date in to database....i just know the code for show time n date..
datetimepicker.value=datetimepicker.now
how can i store it into database....can i use the update same as textbox and combo box..example like receipt there is date on top...when end of month i need retrieve from 1/1/08 until 31/1/08 how i can write the code
to update the latest date,and i stil can retrieve previous date...
i try below this but can't ,can some one teach me or give some idea..
"Me.TimeTableAdapter.Update(Me.timeDataSet.timeIn)"
can any one help me up..thanks in advanced....
this problem should be solved using vb.net 2005 and sql server for database
kevin
modified on Monday, March 31, 2008 10:10 AM
|
|
|
|
|
If you want to put data into an SQL database, you'll want to look at the INSERT command and it's uses. If you want to select data from an SQL database, you'll want to look at the SELECT command as well.
Whenever you insert a row into an SQL database, it will remain there unless you delete it, so running SELECT commands in order to handle data will not remove anything.
Here's a helpful link that explains a lot about SQL queries.
http://www.w3schools.com/sql/[^]
|
|
|
|
|
I'm geting an error message saying that "no value given for one or more required parameters"
e.fullPath is correct and the feild names are identical to the ones in excel apart from 'reason mobilised'. I have put it in [] because of the space. I would do a select * but there are many other feilds that don't need to be read at this stage.
Here's the code:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;" _
& "data source=" & e.FullPath & "; " & "Extended Properties=Excel 8.0;")
Dim DtSet As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
' Select the data from Sheet1 of the workbook.
MyCommand = New System.Data.OleDb.OleDbDataAdapter("select INCIDENT_NO," _
& "INC_TYPE,ESTATE,TOWN,COUNTY,NAME_AND_PHONE_NO,CALLSIGN,[REASON MOBILISED]," _
& "MOBS_DT,MTI,INATT,STOP,MAV,AHS,OPERATOR_INFO from [sheet1$]", MyConnection)
DtSet = New System.Data.DataSet
MyCommand.Fill(DtSet)
MyConnection.Close()
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
As always any help you can provide will be appreciated.
Colonel-yum-yum
|
|
|
|
|
On what line does the error occur??
It looks like you missing a couple of parameters from the connection string, specifically HDR and IMEX.
HDR tells the provider that the first row of the sheet container header names for each column. IMEX tells it the any columns that are determined to have mixed type data, some rows as numbers, some as text, should be treated as a text column.
Also, at the end of the SQL statement, there is a FROM clause. Make sure the name specified (Sheet1 in this example) matches the name of the sheet in your Excel workbook. It should be the sheet name with a $ appended to it.
Imports System.Data.OleDb
.
.
.
If File.Exists(e.FullPath) Then
Dim connStr As String = String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=Excel 8.0;HDR=Yes;IMEX=1", e.FullPath)
Dim conn As New OleDbConnection(connStr)
Dim ds As New System.Data.DataSet
Dim comm As New OleDbDataAdapter("SELECT INCIDENT_NO,INC_TYPE,ESTATE,TOWN,COUNTY,NAME_AND_PHONE_NO,CALLSIGN,[REASON MOBILISED]," & _
"MOBS_DT,MTI,INATT,STOP,MAV,AHS,OPERATOR_INFO FROM [Sheet1$]", conn)
comm.Fill(ds)
End If
|
|
|
|
|
Hi all, I have been attempting sending HTML formated emails with Inline images. the emails apear to be sent OK (no exceptions) however the email is 'lost' in space, My guess is that it is being blocked by the hosting/ISP company, when I send HTML mail without images - the email is sent and received fine, here is a sample code as I use it, (I also tried the AlternateView option with the same result)
Dim EM As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage(txtFrom.Text, txtTo.Text)
Dim A As System.Net.Mail.Attachment = New System.Net.Mail.Attachment(txtImagePath.Text)
Dim RGen As Random = New Random()
A.ContentId = RGen.Next(100000, 9999999).ToString()
EM.Attachments.Add(A)
EM.Subject = txtSubject.Text
EM.Body = "<body>" + txtBody.Text + "<br><img src='cid:" + A.ContentId +"'></body>"
EM.IsBodyHtml = True
Dim SC As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient(txtSMTPServer.Text)
SC.Send(EM)
Any ideas how to solve this issue?
|
|
|
|
|
yaronbo wrote: My guess is that it is being blocked by the hosting/ISP company,
Probably true.
yaronbo wrote: Any ideas how to solve this issue?
Contact the ISP to see what they're blocking. It's possible you can't get around this at all because you're using a technique commonly used by spammers to try to get past spam filters.
|
|
|
|
|
I want to align DatagridView header to right. How can do this?
Gurudatta B. Shelke
|
|
|
|
|
hi,
select "ColumnHeaderDefaultCellStyle" property and click on ellipse button . this open a new window.
From this window you can select different property which is apply to Each Column Header of datagridview.
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Thanx Rupesh..
But my requirement is little bit different. 1st columns header should be left aligned and all others headers should be right aligned. I think i need to do it dynamically but how? can u tel me?
Gurudatta B. Shelke
|
|
|
|
|
try this:
dgv.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
the column at index 0 will be changed
hope it will help
edited :
oopppsss.... i posted code in C#, try to convert it
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
thanx once again..
yes I have tried that way also. like
DG_DISPLAY_MW.Columns(l).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
DG_DISPLAY_MW.Columns(l).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
this code works for Cell other than header cell. means they become right align but header cell is still left align.
Gurudatta B. Shelke
|
|
|
|
|
hi,
at design time, select the datagridview and click on smart tag(which is top right corner of the datagridview). Now select option "Edit column". when you Choosing this option , a small window is appear.Left hand side part of this window,show the column. choose any column and then select "DefaultCellStyle" property and click on ellipse button.Now once again a window appear. from this window you set alignment (and others) property for individual column .
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
i am working on word macro. i have to copy down selected headings from one document into another.
For that i want to read heading 1 so as to display them on labels on a form . Can anyone guide me in this.
|
|
|
|
|
I am developing an application using VB.Net. On backend I am using MS Access and SQL Server 2005 both. I want to Import data from MS Access table to SQL Server 2005 table using VB.Net. For example, I have a table on MS Access Database name "tblInternship". And I have a table with the same name on SQL Server 2005 Database. Now I want to Import data from Access.tblInternship to SqlServer.tblInternship using Vb.Net.
How I can do this. Please send me a code or make me understand to solve this problem.
|
|
|
|
|
Hi,
This can be done in the following manner in SQL query analyzer.
---------------------------------------------------------------------
BEGIN CODE
-- option 1
INSERT INTO sqltable (field1, field2, field3)
SELECT FIELD2, FIELD2, FIELD3
FROM OPENDATASOURCE(
'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\accessfile.mdb";
User ID=Admin;Password=',tablename)
-- option 2
INSERT INTO sqltable (field1, field2, field3)
SELECT FIELD2, FIELD2, FIELD3
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','c:\accessfile.mdb';'admin';'', tablename)
END CODE
---------------------------------------------------------------------
You may try the same thing using VB.Net.
I hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
hi,
i need to solve a problem can any one help
problems:
1. i've have some images in database,i want to make it scroll in my windows application when i select a particuler image it should display the details in the controls in that form
this problem should be solved using vb.net 2005 and sql server for database
|
|
|
|
|
Justin Pravin wrote: 1. i've have some images in database,i want to make it scroll in my windows application
Scroll?? Like how?
It sounds like you're going for more functionality than you need right now. Try just showing an image in a picture box and handling it's click event to get and show the details of whatever you need first. Then you can move on to making it look fancy.
|
|
|
|
|
how to i save time n date in to database....i just know the code for show time n date..
datetimepicker.value=datetimepicker.now
but how to i save it ....can i use the update same as textbox and combo box..example like receipt there is date on top...when end of month i need retrieve from 1/1/08 until 31/1/08 how i can write the code
i update the latest date,and i stil can retrieve previous date...
Me.TimeTableAdapter.Update(Me.timeDataSet.timeIn)
do u all can help me up thanks....
this problem should be solved using vb.net 2005 and sql server for database
modified on Monday, March 31, 2008 3:37 AM
|
|
|
|