|
ChPortos wrote: What I can't find is the way to link the value to the name of the Ressource I have to use.
The My stuff is all shortcuts. It's actually loading the resource by name, and if you do that, too, you can use a variable to specify the name.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
hi guys,
Am having a bit of a problem. I would like to read data from an access table but only within a certain range.
to be more specific, its an accounting application and would like the balance to calculated from the last time i closed month to now.
The indicator for closing month is number
Squth
|
|
|
|
|
collo wrote: I would like to read data from an access table but only within a certain range.
Just create a query that runs against the certain range you want.
Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon
|
|
|
|
|
i have a problem for making excel file. please tell me how to make it, thanks.
|
|
|
|
|
There are many ways.
_Using OLE Automation
_Using thirst party component: Aspose, FarPoint...
_Make it yourself
|
|
|
|
|
not helpful at all
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Neither was the question...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Here is a simple app that takes a dataset and writes a worksheet per data table in the set
Public Sub writeToExcel(ByVal source As DataSet)
Dim doc As New System.IO.StreamWriter("Excel.xls") 'use .xls even though its an xml file
Dim startExcelXML As String = ""
startExcelXML &= "<xml version>"
startExcelXML &= vbNewLine & "<Workbook " + "xmlns=""urn:schemas-microsoft-com:office:spreadsheet"""
startExcelXML &= vbNewLine & Microsoft.VisualBasic.Chr(10) & "" + " xmlns =""urn:schemas-microsoft-com:office:office"""
startExcelXML &= vbNewLine & "xmlns:x=""urn:schemas- microsoft-com:office:" + "excel"""
startExcelXML &= vbNewLine & "xmlns:ss=""urn:schemas-microsoft-com:" + "office:spreadsheet"">"
'write the styles tags that format the data and cells properly
startExcelXML &= vbNewLine & "<Styles>"
startExcelXML &= vbNewLine & " <Style ss:ID=""Default"" ss:Name=""Normal"">"
startExcelXML &= vbNewLine & " <Alignment ss:Vertical=""Bottom""/>"
startExcelXML &= vbNewLine & " <Borders/>"
startExcelXML &= vbNewLine & " <Font/>"
startExcelXML &= vbNewLine & " <Interior/>"
startExcelXML &= vbNewLine & " <NumberFormat/>"
startExcelXML &= vbNewLine & " <Protection/>"
startExcelXML &= vbNewLine & " </Style>"
startExcelXML &= vbNewLine & "<Style ss:ID=""ColHeader"">"
startExcelXML &= vbNewLine & "<Alignment ss:Horizontal=""Center"" ss:Vertical=""Bottom""/>"
startExcelXML &= vbNewLine & "<Font x:Family=""Swiss"" ss:Size=""8"" ss:Bold=""1""/>"
startExcelXML &= vbNewLine & "<Interior ss:Color=""#C0C0C0"" ss:Pattern=""Solid""/>"
startExcelXML &= vbNewLine & "</Style>"
startExcelXML &= vbNewLine & " <Style ss:ID=""Reg"">"
startExcelXML &= vbNewLine & " <Font " + "x:Family=""Swiss"" ss:Bold""0""/>"
startExcelXML &= vbNewLine & " </Style>"
startExcelXML &= vbNewLine & "</Styles>"
'write the header to the file
doc.WriteLine(startExcelXML)
'write one sheet per table
For Each tab As DataTable In source.Tables
Dim sheetname As String = "<Worksheet ss:Name="
sheetname &= Microsoft.VisualBasic.Chr(34)
sheetname &= tab.TableName.Trim
sheetname &= Microsoft.VisualBasic.Chr(34)
sheetname &= ">"
doc.WriteLine(sheetname)
doc.WriteLine("<Table>")
'write the column headers
doc.WriteLine("<Row>")
For Each col As DataColumn In tab.Columns
doc.Write("<Cell ss:StyleID=""ColHeader""><Data ss:Type=""String"">")
doc.Write(col.ColumnName)
doc.WriteLine("</Data></Cell>")
Next
doc.WriteLine("</Row>")
'write the table
For Each row As DataRow In tab.Rows
doc.WriteLine("<Row>")
'Dim i As Integer
For i As Integer = 0 To tab.Columns.Count - 1
doc.Write("<Cell ss:StyleID=""Reg""><Data ss:Type=""String"">")
doc.Write(row.Item(i))
doc.WriteLine("</Data></Cell>")
Next
doc.WriteLine("</Row>")
Next
doc.WriteLine("</Table>")
doc.WriteLine("</Worksheet>")
Next
doc.WriteLine("</Workbook>")
doc.Close()
End Sub
this can be opened in excel. You will have to add your own formating to make the sheet look like you want, to do that just make changes, save it and open it and see what it did to the tags. Then make your code do the same.
Hope this helps
Kevin
-- modified at 9:55 Tuesday 28th November, 2006
|
|
|
|
|
Hey guys
I m reading from a text file (that contains data like the following)
What I want is to simply get the data between the bold lines-each block alone
Any hint for that?
A1/EXT "BK82 LB73 21233" 105 061018 1804
EXTERNAL ALARM
COOLING ALARM
A2
A1/POWER "BK82 LB73 21233" 362 061019 0947
EXTERNAL ALARM
EDL FAILURE KAA
A1
A1/POWER "BK82 LB73 21233" 364 061019 0947
.....
thx
Regards
Ramy
|
|
|
|
|
You need to read the whole file, and use a regex to find the lines that are in the format you want, assuming you can't rely on them being on the same lines.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
seems that i wasnt clear,
what i want is to read each block alone.(the sizes of the blocks are different)
i have hilighted the first line of each block in bold, in order to make myself clear..
Regards
Ramy
|
|
|
|
|
Do you mean you want to read only part of a text file, not the whole thing ? You can't do that. There are APIs that can make it look like you can, but the only way to find the bits you want, is to read the whole file, throwing away the bits you don't want. The easiest way is to read in the whole file and search it, it's also the most efficient.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
seems i m expressing my self
if u take a look back to my first displayed msg:
what i want is : to read each block of that file alone ,and assign it to a string value (then insert it into a DB)
i have done the following-this is part of it
dim read as string<br />
while not sr.peerk=-1<br />
checkstr =sr.readline<br />
read &=checkstr & vbnewline<br />
end while
the problem that i m facaing is that i cant retrieve each block alone
all the file is being concatanated,note : the block sizes are variant
the only way to separate them is by the presence of the double quote,after each presence of double quote:"read" should be cleared,and filled again (take a look at the first msg)
thanks
Regards
Ramy
|
|
|
|
|
charchabil03 wrote: the problem that i m facaing is that i cant retrieve each block alone
Isn't each block one line tho ?
charchabil03 wrote: read &=checkstr & vbnewline
It would be quicker to just read the entire file, instead of parsing for lines. You can turn it into a string array with split, and work your way through from there, looking for your blocks. Assuming you don't want to filter the lines before adding them to the 'read' variable.
charchabil03 wrote: the only way to separate them is by the presence of the double quote,after each presence of double quote:"read" should be cleared,and filled again (take a look at the first msg)
OK, I get it now. In that case, you just need to search checkstr for a ", right ? There's a Contains method on the string class.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hi All
I have made one application which logs to a government website from my application.
For that purpose i have created a web explorer on my form and i have specified that particular URL name.
As soon as i run that form it opens that particular website
Now In that website there is 2 textboxes (user name and password) and 2 buttons (submit and cancel)
When I count no. of item by webcontrol1.controls.items.count() gives me 4
Is there a way to access these controls directly from my application by using webcontrol.controls.items(0).text = "XYZ"
something like this.......I am not able to get through with this
Also I can find a particular string in the document by
webcontrol1.document.outertext.contains("ABC") returns .T. , but how to select that particluar text automatically after finding it.
Please Help....Its Very Urgent......
Thanx In Advance
Riyaz Zujer Patanwala
I.T.Programmer
Al Jaber Energy Services
P.O.Box 47467
Abu Dhabi
U.A.E.
|
|
|
|
|
I am able to fetch services running on a remote system through WMI
Now i want to stop/Start a service.
I have not found any method in WMI to start or stop a service through WMI on remote system
Is there a way i can start and stop service on a remote system?
|
|
|
|
|
You have to call the StartService and StopService methods on the Win32_Service objects that your getting back from the remote machine.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thnx,
is there a list where i can find out all the methods WMI classes
|
|
|
|
|
|
hi all,
when internet connection failed program hangs for a while
and gives a message(i wrote as when internet connection failed come out program even though it was hanging)
How can we know the internet connection failed.
can any one help.
|
|
|
|
|
|
If the following code shows you what properties and methods exist in BuddyItem when you test the member of X, then it's early-binding.
I didn't know that it would actually perform the typecast during design-time. Are you sure it's allowing you to access the inherited members through X at design-time?
Jonathan Sampson
www.SampsonResume.com
|
|
|
|
|
|
|
cmd.CommandText = "insert into ssc(firstname,lastname,phno) values ('" & t1.Text & "','" & t2.Text & "'," & t3.Text & ")"
cmd.Connection = cn
cmd.ExecuteReader()
i am getting a syntax error like:
Server Error in '/Datagrid' Application.
--------------------------------------------------------------------------------
Line 1: Incorrect syntax near ')'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near ')'.
please help me..
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0
tirumal
|
|
|
|