|
Database, database, and finally database. First create the necessary tables in a database and populate them with data. Once all that is done, you can start writing your app by designing the business layer, in other words, the rules by which you need to create schedules, etc. and only when all that is done you start making the necessary form(s) to handle all possible interaction with the business layer (exceptions in schedules, etc) and the database (adding new songs, etc).
Very important! Try to design all business logic into your database (For example: song 1 may never be played on Friday: Table_Songs.NoNoDay = "Friday"), and hard code as little as possible.
Good luck with it,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi
In my application i am creating a text file and write some text to
it then i am checking if file exist or not if exist i want to write
to a new line but while doing i am getting an error.
Object reference not set to instance of an object.How can i do this.
Plesae guide me to do this. my Code is as follow.
for i= to Count<br />
Dim id As String = xMsg.MsgId()<br />
Dim sFileName As String<br />
sFileName = "C:/text1.txt"<br />
Dim newline As String = String.Empty<br />
'Dim tw As TextWriter<br />
If Not IO.File.Exists(sFileName) Then<br />
MessageBox.Show("File Not Found")<br />
Dim TextFile As New StreamWriter(sFileName)<br />
<br />
TextFile.WriteLine(id)<br />
TextFile.Close()<br />
Else<br />
MessageBox.Show("File Found. File was created on: ")<br />
'Dim TextFile As System.IO.TextWriter<br />
Dim TextFile As StreamWriter<br />
<br />
TextFile.WriteLine(id)<br />
TextFile.Close()<br />
<br />
End If<br />
<br />
Next
Thanks.
Rahul
|
|
|
|
|
Hi rahul.net11
To solve the problem
Example:
dim str as string
str= " vbcrlf "
TextFile.WriteLine(id & str)
Rami Abd Alhalim
|
|
|
|
|
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.
|
|
|
|