|
Hi
Sorry this soluation Correct
TextFile.WriteLine(id & vbCrLf)
Rami Abd Alhalim
|
|
|
|
|
Thanks.
For your rply.I tried it.
df
|
|
|
|
|
hi rahul,
use following procedure
Private Sub CreateTextFile(ByVal FilePath As String, ByVal data As String)<br />
Dim oFile As System.IO.File<br />
Dim oWrite As System.IO.StreamWriter<br />
Dim oRead As System.IO.StreamReader<br />
Dim PreviousData As String = ""<br />
Dim CheckHypen As String<br />
<br />
If File.Exists(FilePath) Then<br />
oRead = oFile.OpenText(FilePath)<br />
While oRead.Peek <> -1<br />
If PreviousData = "" Then<br />
PreviousData = oRead.ReadLine()<br />
Else<br />
CheckHypen = oRead.ReadLine<br />
PreviousData = PreviousData & ControlChars.NewLine & CheckHypen<br />
End If<br />
End If<br />
End While<br />
oRead.Close()<br />
End If<br />
<br />
oWrite = oFile.CreateText(FilePath)<br />
<br />
If PreviousData = "" Then<br />
PreviousData = data<br />
oWrite.WriteLine(PreviousData)<br />
Else<br />
PreviousData = PreviousData & ControlChars.NewLine & data<br />
oWrite.WriteLine(PreviousData)<br />
End If<br />
<br />
oWrite.Close()<br />
end sub<br />
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Thanks.
For your rply.I tried it.
Rahul
|
|
|
|
|
Hi,
try:
<br />
Dim TextFile As StreamWriter<br />
TextFile = File.AppendText(sFileName)<br />
and I think this will interest you too:
<br />
Dim fi As New FileInfo(sFileName)<br />
'fi.CreationTime now holds the creation date/time<br />
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thanks.
For your rply.I tried it.
Rahul
|
|
|
|
|
the reason you are getting the " Object reference not set to instance of an object. " error, is because when you are checking if the file exists you are NOT declaring the StreamWriter as NEW
see your code from below.
rahul.net11 wrote: MessageBox.Show("File Found. File was created on: ")
'Dim TextFile As System.IO.TextWriter
Dim TextFile As StreamWriter
TextFile.WriteLine(id)
TextFile.Close()
End If
you need to declare an object as new / make sure the object exists before attempting to use it.
you should have the following sort of thing
Dim TextFile As New StreamWriter(" your file path or stream path here ")
regards.
<--- my signature --->
<font color="blue">Csharp</font> me = (<font color="blue">Csharp</font>)Dynamic_Sysop; <font color="#008000">// My Signature.</font><br><font color="#008000">$twins</font> = <font color="#008000">me.twins</font>(<font color="#800080">"Taylor"</font> , <font color="#800080">"Delta"</font>); <font color="#C0C0C0">// My twin daughters.</font><br>echo <font color="#008000">$twins</font>;
|
|
|
|
|
Asking the same question multiple times in the same day is called "spamming". It's considered very rude.
|
|
|
|
|
hi,
I am using vb.net 2005 with the report viewer control and the built-in
reports (NOT CRYSTAL REPORTS). The report viewer fills a regular form,
which when opened grabs the data for the report (based on certain parameters)
The reports themselves are RDLC files.
following code properly display the preview of my report
Private Sub ShowReport(ByVal Id As Long)<br />
Dim mdIns As New mdGlobal<br />
Dim str As String<br />
Dim AwiCashFlowDataSet As New DataSet<br />
str = "SELECT * FROM Analysis where c_id=" & Id<br />
CashFlowDataSet = mdIns.GetResultFromQuery(str) 'retun dataset with data<br />
CashFlowDataSet.Tables(0).TableName = "ReturnOnCash"<br />
<br />
Dim RDS As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource<br />
ReturnOnCashBindingSource.DataSource = CashFlowDataSet<br />
ReturnOnCashBindingSource.DataMember = "ReturnOnCash"<br />
RDS.Name = "CashFlowDataSet_ReturnOnCash"<br />
RDS.Value = ReturnOnCashBindingSource<br />
Me.ReportViewer1.LocalReport.DataSources.Add(RDS)<br />
If mdChecking.ReportNumber = 1 Then<br />
ReportViewer1.LocalReport.ReportEmbeddedResource = "Analysis.rptReturnOnCash.rdlc"<br />
Else<br />
ReportViewer1.LocalReport.ReportEmbeddedResource = "Analysis.rptCashFlow.rdlc"<br />
End If<br />
<br />
Me.ReportViewer1.RefreshReport()<br />
If IsPrint = False Then<br />
Me.Show()<br />
Else<br />
IsPrint = False<br />
End If<br />
<br />
End Sub
now i want to print the report without preview but i can't. because i dont know
anybody have idea that how can i print the report without preview using reportviewer
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
sum(fld,condfld)
what for this. And can give any example to explain this............
Senthil S
Software Engineer
|
|
|
|
|
The sum of two numbers is what you get when you add them. Given this snippet, bereft of all context, it's hard to say more.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Senthil S wrote: sum(fld,condfld)
This will give you a sum of fld for each condfld - without this second parameter, you will get a sum of fld for all the records in the report.
For example, if you have created a group section called Name, and would like to print a sum of fld for each Name, you need to put in a formula at the group section saying sum(fld,Name).
Hope this helps.
|
|
|
|
|
Hi
I am developing an applicaion in which i am retriving mail from server
using pop3 protocol and indy Liabery.Now i want to retrieve only unread
mails from server.How can in detect which mail is read and which mail is
unread.
Thanks.
Rahul
|
|
|
|
|
I have a windows application fetching images from windows xp machine which to client machine enabling them to view images.
The problem is that windows xp machine which we are using as images hosting server allows only 10 connections at a time and so, only 10 clients can see images.
what to do to override or get rid of this. Can virtual os serve the purpose well???
Thanks,
|
|
|
|
|
If you're running a client-server architecture, then actually put a server at the back end. It doesn't need to be rackable, server-class hardware, but definitely put a server OS on it. Windows 2003 Server will get rid of your connection limit.
|
|
|
|
|
Jwalant Natvarlal Soneji wrote: what to do to override or get rid of this.
Nothing. It's the licensing limits of the workstation operating systems, like NT 4 Workstation, 2000 Professional, XP. In order to increase this limit, you have to use a Server version of Windows, like Windows Server 2003.
|
|
|
|
|
working on an algorithm that requires a sort in 2 ways.
1st i need to sort an array A - Z (the array.sort(myarray) works fine in this)
2nd i need to sort according to the length of the string in the array.
example
myarray() = {a,ab,aaa,abc,bad}
myarray sorted = {a,aaa,ab,abc,bad}
myfunction(myarray) 'what i want should be {a,ab,aaa,abc,bad}
|
|
|
|
|
I'm assuming your using VB.Net here.
You want to impliment an IComparer[^]
|
|
|
|
|
actually tried IComparer maybe i did it wrong. more research i suppose
|
|
|
|
|
iirc when implimenting an IComparer you just need to provide the logic for saying is one object is greater or less than another.
The sorting method then will just use it as part of it's functionality.
|
|
|
|
|
I would like to create the crystal report? How come visual basic express edition 2005 don't have the option to add crystal report under add new item? Any idea how to do it?
Regards,
SH
|
|
|
|
|
It should be there if you have selected General Envirnment.
To check the same go to Tools menu & change it to "General". I hope it will work.
|
|
|
|
|
cmd.CommandText = "select * from reglz where fatrname LIKE '%" & TextBox1.Text & "%' "
DataGridView1.Refresh()
ad.SelectCommand = cmd
ad.Fill(ds, "reglz")
DataGridView1.DataSource = ds.Tables("reglz")
this code for the table that called reglz
what i want to do is how can i make this sql statement on 2 tables together at the same time in a datagride
in other words i wanna see the 2 tables in the datagride with me condition that i have made in sql statement in reglz which is (where fatrname LIKE '%" & TextBox1.Text & "%' ")
then i want to save another word instead of the current one in database
and here my working code
Dim x As String
x = "'" & TextBox2.Text & "'"
Call conn()
cmd.CommandText = "update reglz set fatrname = " & x & " where fatrname LIKE '%" & TextBox1.Text & "%' "
DataGridView1.Refresh()
ad.SelectCommand = cmd
ad.Fill(ds, "dd")
DataGridView1.DataSource = ds.Tables("dd")
but how can i apply this code to the 2 table
SO what i want is :-
how can i select 2 tables to show them in a datagrid
how can i save any word for the two tables accroding to my condition .
plz help me
and thanks
|
|
|
|
|
Good morning MageDHV
i hope following code will help you. if you want to update,Insert,Delete, you have to Add relations to this Code, but this one Will Display you 2table. i Suggest you do one thing at a time, try Displaying results from 2tables and then display results based
Dim strconnection As String = "workstation id=5875-049;packet size=4096;user id=sde;Password=topology;data source=SGIICORNETGS01;persist security info=False;initial catalog=Tshwane_Valuations"
Dim cn As SqlConnection = New SqlConnection(strconnection)
cn.Open()
Dim cmdstr as String = "Select Property_Mass.boundary_Area, " _
" & Property_Mass.Actual_Extent, Property_Mass.Attrib_code, " _
" & Property_Mass.Lis_key, Property_Mass.Func_key, Property_Mass.Density, " _
" & Property_Mass.New_Net_Usable_Extent, Property_Mass.New_Total_Land_Factor, " _
" & Property_Mass.New_AdJ_Extent_1, Property_Mass.New_Points_1, Property_Mass.New_ADJ_Extent_2 , " _
" & Property_Mass.New_Points_2, Property_Mass.Fin_LS_Prediction, Property_Mass.Confidence_score , " _
" & Property_Mass.Flagtype, Property_Summary.Purchase_Date, Property_Summary.Purchase_Price " _
" & from Property_Mass, Property_Summary " _
" & where Property_Mass.Lis_key = Property_Summary.Lis_key "
Dim da As New SqlDataAdapter(cmdStr, cn)
Dim ds As New DataSet
da.Fill(ds)
Dim dv As New DataView(ds.Tables("Property_Mass"))
dgDetails.DataSource = dv
it will look Buggy, but i want you to get th Logic, you create a Join and test it if its working and apply it in your string variable and display it on your table, tell me if you were able to do that, and we will go to the search based on textbox input. that would be easy you will see.
Vuyiswa Maseko
|
|
|
|
|
Hi all,
Here i need to create a syntax tree to check the grammar of a string. The creating syntax tree should have our own created rules to check that string. Please help me to solve this issue.
Cheers,
Ajay
|
|
|
|