|
Just itterate the first array and concatenate the string with the other.
for int i=0 to array1.Length
array1[i] = array1[i] + "," + array2[i];
next
assuming you first check that both arrays have the same number of elements, this will work fine.
|
|
|
|
|
I'm trying to access advanced file properties such as revision Number,Title,Comments etc.
I have already created the file object,i can see how you get at file attributes such as size etc but don't know how to get at the advanced properties
thanks
Steve
|
|
|
|
|
I read that most of these custom properties are stored as part of the file itself and are retrieved by the application that created the file e.g MSWord, anyone know if that is true?
|
|
|
|
|
Dear Friends,
I am developing one simple application in vb.Net. Can some one tell me how to insert a record in access table in VB.Net, How to make a standered connection same as in VB6 we are opening connection only once in a main module. and then simply we are using with the record set for e.g. RsSave.open Ssql,Conn.
Can please some one show me the sample code for the above mentioned vb6 code in VB.NET.
Your quick response will be highly appreciated.
Thanks
Murtuza Patel
|
|
|
|
|
you have a class has name,application (Gets the path for the executable file that started the application, not including the executable name.) and make your file databas in same folder, which has executable file
Me.OleDbConnection1.ConnectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=1;Jet OLEDB:Database Password=;Data Source=" & application.startup & "\Northwind.mdb"&";Passwo" & _
"rd=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global Bulk Transactions=1;Provider=""Micro" & _
"soft.Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet OLEDB:SFP=False;Extended Prop" & _
"erties=;Mode=Share Deny None;Jet OLEDB:New Database Password=;Jet OLEDB:Create S" & _
"ystem Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Comp" & _
"act Without Replica Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False"
123
-- modified at 18:39 Thursday 30th March, 2006
|
|
|
|
|
In a base form, i set KeyPreview properties to "TRUE". I want to Raise Click event of inherited forms AcceptButton at . When user clicks to F1.
|
|
|
|
|
i solved
AcceptButton.PerformClick
|
|
|
|
|
hi everybody
Can someone tell how i can access file of a folder on server
means www.something.com/pdf where pdf is a folder and it has 5 files such as file1 to file5 so i want to access these file name
is it possible in visual basic ?
if anyone have idea about it pleaase help me
Thanks
|
|
|
|
|
If you have access to the folder over a LAN and it's a shared folder, then you can use the Dir[^] function.
Dim fileName As String
fileName = Dir("\\MyComputer\SharedFolder\*.pdf")
Do While fileName <> ""
' Do something with the file.
'
' Get next file name.
fileName = Dir()
Loop
|
|
|
|
|
help me, I want to export the datagrid's data to excel using vb.net,asp.net. Please Suggest me what will I do.
|
|
|
|
|
I would loop through the datasource as follows: NB The starting range eg "A1" is sent to the function.
'--------------------------------------------------
Public Overloads Sub WriteDataToRange(ByVal dt As DataTable, ByVal StartingRange As String)
Dim iRow As Integer
Dim iColumn As Integer
Dim iRows = dt.Rows.Count
Dim iColumns = dt.Columns.Count
'Fill an array with the datatable
Dim aRange(1, 1)
With dt
ReDim aRange(iRows - 1, iColumns - 1)
For iRow = 0 To iRows - 1
For iColumn = 0 To iColumns - 1
aRange(iRow, iColumn) = dt.Rows(iRow).Item(iColumn).
Next
Next
End With
'copy array to range on excel worksheet
'NB: oWS (Excel.WorkSheet object must be set first. In this case it is set
'as a property before this function is called
Dim range As Object = oWS.Range(StartingRange)
range = range.resize(iRows, iColumns)
range.value = aRange
aRange = Nothing
End Sub
'--------------------------------------------------
Alternatively you could make use of ado.net as follows (without the need to open an instance of excel):
Conn.Open _
"Provider=Microsoft.Jet." & _
"OLEDB.4.0;" & _
"Data Source=C:\Temp\Nwind.mdb;" & _
"Jet OLEDB:Engine Type=4;"
Conn.Execute "SELECT * INTO " & _
"[ExcelCust] IN " & _
"'C:\Temp\Cust.xls'" & _
"'Excel 8.0;' FROM [Customers]"
Unless the resultset is large, I use the first method as it enables me to apply custom formats.
If these methods are not suitable then I will work out how to do it directly from the grid.
Roland Pheasant
|
|
|
|
|
Hi,
I am working crystal reports. I want total of field which has datatype as text in database. So in grand total crystal reports doesn't show the 'sum'
option. i tried to convert into currency then apply sum formula in formaula fields. but not working. if anybody there has soln plz.
Ash. R.
|
|
|
|
|
I want to display data in a datagrid and then want to export that data to excel in vb.net.plz help me ASAP.
thnx
josh
|
|
|
|
|
<%@ Import Namespace="System.Data.OleDb" %><br />
<%@ Import Namespace="System.Data" %><br />
<HTML><br />
<script language="VB" runat="server"><br />
Dim MyConnection As OleDbConnection<br />
Public Sub Page_Load(ByVal Sender As System.Object, ByVal E As System.EventArgs) Handles MyBase.Load<br />
MyConnection = New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; Data Source=" & Server.MapPath("database/utenti.mdb"))<br />
BindGrid("id")<br />
End Sub<br />
<br />
Sub BindGrid(ByVal SortField As String)<br />
Dim DS As DataSet<br />
Dim MyCommand As OleDbDataAdapter<br />
MyCommand = New OleDbDataAdapter("select * from utenti", MyConnection)<br />
DS = New DataSet<br />
MyCommand.Fill(DS, "utenti")<br />
Dim Source As DataView = DS.Tables("utenti").DefaultView<br />
Source.Sort = SortField<br />
MyDataGrid.DataSource = Source<br />
MyDataGrid.DataBind()<br />
End Sub<br />
<br />
Sub ToExcel(sender As Object, e As System.EventArgs)<br />
Response.ContentType = "application/vnd.ms-excel"<br />
Response.Charset = ""<br />
Me.EnableViewState = False<br />
Dim tw As New System.IO.StringWriter<br />
Dim hw As New System.Web.UI.HtmlTextWriter(tw)<br />
MyDataGrid.RenderControl(hw)<br />
Response.Write(tw.ToString())<br />
Response.End()<br />
End Sub<br />
</script><br />
<body><br />
<form runat="server" ID="Form1"><br />
<asp:Button id="Button1" runat="server" Text="Excel" OnClick="ToExcel"></asp:Button><br />
<br><br />
<br><br />
<ASP:DataGrid id="MyDataGrid" runat="server" Width="700px" BackColor="White" BorderColor="#CCCCCC"<br />
CellPadding="3" Font-Name="Verdana" Font-Size="8pt" HeaderStyle-BackColor="#aaaadd" BorderStyle="None"<br />
BorderWidth="1px" Font-Names="Verdana" EnableViewState="False"><br />
<ItemStyle ForeColor="#000066"></ItemStyle><br />
<HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#006699"></HeaderStyle><br />
</ASP:DataGrid><BR><br />
</form><br />
</body><br />
</HTML>
_____________________
Proud to be Albanian
_____________________
|
|
|
|
|
if i work on Vb.net (not asp.net) , what will i do?
|
|
|
|
|
I subclassed a datagrid and use this code:
Dim x As Integer, y As Integer
Dim wb As Excel.Workbook
Dim ws As Excel.Worksheet
Dim oExcel As Excel.Application
Static SheetCount As Integer = 1
Dim tbl As DataTable = CType(Me.DataSource, DataTable)
Cursor.Current = Cursors.WaitCursor
If Not Me.ReadOnly Then
Dim changedRows As New ArrayList
Dim row As DataRow
For Each row In tbl.Rows
If row.RowState <> DataRowState.Unchanged Then
changedRows.Add(row)
End If
Next
If changedRows.Count > 0 Then
Cursor.Current = Cursors.Default
MsgBox("There are pending data updates for this grid. Please save these updates to the database prior to exporting the data to Excel.", MsgBoxStyle.Information, "Pending Updates")
Exit Sub
End If
End If
If oExcel Is Nothing Then
oExcel = New Excel.Application
End If
wb = oExcel.Workbooks.Add
ws = wb.Sheets.Add
ws.Name = "Export" & SheetCount
SheetCount = SheetCount + 1
'write column headers
For x = 0 To tbl.Columns.Count - 1
ws.Range(Chr(65 + x) & "1").Value = tbl.Columns(x).ColumnName
ws.Range(Chr(65 + x) & "1").Font.Bold = True
Next
'write data
For x = 0 To tbl.Rows.Count - 1
For y = 0 To tbl.Columns.Count - 1
ws.Range(Chr(65 + y) & (x + 2).ToString).Value = tbl.Rows(x).Item(y)
Next
Next
oExcel.Application.Visible = True
' Release Application object and allow Excel to be closed by user:
If Not oExcel.UserControl Then oExcel.UserControl = True
System.Runtime.InteropServices.Marshal.ReleaseComObject(oExcel)
oExcel = Nothing
Cursor.Current = Cursors.Default
As you can see there are several references to "Me" in this routine for my use. In your case you would simply replace "Me" with the name of your datagrid. You will also need to add a reference to Excel in your project.
Hope this works for you.
Dean
|
|
|
|
|
Does anybody know others IDE for write and debug vb code? (for replace VB6)
Thanks in advance.
|
|
|
|
|
|
Can anyone help me, please!!!
I got problem regarding to my datareport. I need a long size paper (8.5" X 14") to print my data. How can I do that in "LANDSCAPE" format???
Thanks in advanced!!!;)
|
|
|
|
|
hello guys its me again i would like to ask anybody on how to toggle the check state in context menu sub item......how to disappear the check when i click and vice versa.....
hope anybody can help me......i admit im new in vb.net
have a nice day everyone
-- modified at 3:41 Thursday 30th March, 2006
|
|
|
|
|
If ContextMenuStripMenuItem1.Checked = True Then<br />
ContextMenuStripMenuItem1.Checked = False<br />
your code <br />
Else<br />
ContextMenuStripMenuItem1.Checked = True<br />
your code <br />
End If
Regards,
Chatura Dilan
If at first you don't succeed, try; try again, so that you know
what not to do the next time. The answer is out there.
|
|
|
|
|
hey Chatura thank you for sending me this code it helps me a lot....now im willing to learn more about VB.net coz i know theres people outher willing to share their knowledge. thanks a lot God Bless you....
before i forgot here's my YM (Yahoo Messenger) id i hope we could talk! thank you again!
and to all people outher thank you guys!!!!!!
|
|
|
|
|
You are welcome It’s nice to have an amiable friend like you.
Regards,
Chatura Dilan
If at first you don't succeed, try; try again, so that you know
what not to do the next time.
|
|
|
|
|
Your question was along the lines of:
My car does not work. Please tell me what is wrong
--------------------------------------------------------
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
hello..
my project is about when web cam detect motion, it will sent alert or messag to pda emulator.How it can sent alert or message to the pda emulator using vb,net 2005??
thanks
|
|
|
|