|
<code>
if instr("read the help or google it","google") > 0 then
Success = true
else
PutSomeEffortInBeforePostingOnAForum = true
end if
if InStrReverse exists then
LookItUp = true
else
StopWastingOtherPeoplesTime = true
end if
</code>
-- modified at 9:07 Wednesday 15th August, 2007
You always pass failure on the way to success.
|
|
|
|
|
LOVE IT!
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
|
i need to make a scheduling system for a guesthouse. (9 rooms). i need a way to scroll through the database (Sql 2005) and view room bookings relative to dates and rooms.
Calendar function and rooms thanks!
|
|
|
|
|
Basically, you need to write a database, in SQL, and then you need to write a simple program that displays your information, and calls the database methods. Smells like homework to me.
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 )
|
|
|
|
|
I have a user input form in which user enters some rich text in a rich text box. I store the rtb1.rtf into database. Now all what I need is to concate all input i.e. concate rtf from all rows (in database) but what happens when the output appears the only text from the first row appears. But I need to prepare whole rtf document containing data from all rows. Please help me in this regard and also let me know if the scenario is not clear
Salman Sheikh
|
|
|
|
|
|
Thanx a lot sir but i am using SQL Server 2000 and using text type to store rtf. here comes exactly the same text returned by the Richtextbox control's rtf Property.
Also i couldn't read the complete article you told for i am not registered user of that site.
Salman Sheikh
|
|
|
|
|
hi
have you tried creating an invisible richtextbox and then apppeding the database rows to the richtectbox
sort of
for eachatabase row
RichTextBox1.Rtf = RichTextBox1.rtf + <db rows="" rtf="">
next
then at the end to get the plaintext just do
val = richtextbox1.text
not elegant but will probably work
HTH
Martin
life is a bowl of cherries
go on take a byte
|
|
|
|
|
first of all thanx everybody.
yes i tried the same way you told but this didn't work. the thing actually is that every record contains the rtf document start elements. so i removed it from every record but the first and i removed ending bracket from every record but the last and this worked well..
once again thanx a lot for your kind reply
Salman Sheikh
|
|
|
|
|
I'm writing an app in which a process(the vb .net component) is executed and a progressbar is updated simultaneously thru a do .. while loop . What i want to do is to add a cancel/stop button. In the stop button event code ,i've written code to 'kill' the running process . But when i execute the form ,the stop button (or for that matter any button) is not clickable,when the process and the do-while-loop code are running .Please Advice.
Regards,
Vivek
|
|
|
|
|
|
the control works only for c#,it doesn't work in vb,can u give me example code for creating threads.
|
|
|
|
|
I have come across the same situation you describe and using threads I coded it something like this:
<code>
Public scanInformThread As Threading.Thread
scanInformThread = New Threading.Thread(AddressOf Me.scanInformThreadProc)
scanInformThread.Priority = Threading.ThreadPriority.Lowest
scanInformThread.Start()
While scanInformThread.IsAlive = True
check if cancel button is pressed
if it is pressed then scanInformThreadProc.Abort()
Yadayada Blahblah
make a cuppa coffee
End While
Sub scanInformThreadProc()
Yadayada Blahblah
do something useful like surf the web
end sub
</code>
Please excuse the pseudocode.
Also note that this is not thread safe so you will need to put:
Control.CheckForIllegalCrossThreadCalls = False
at the beginning of your code to stop the compiler from whining at you.
I hope this helps.
Guy
-- modified at 8:02 Wednesday 15th August, 2007
-- modified at 8:06 Wednesday 15th August, 2007
You always pass failure on the way to success.
|
|
|
|
|
hey
you dont need to do the loop . just start the thread and end the function
then on the buttons onclick event do a scanInformThreadProc.Abort()
HTH
Martin
life is a bowl of cherries
go on take a byte
|
|
|
|
|
You're right.
I just hacked this out of my memory.
Regards
Guy
You always pass failure on the way to success.
|
|
|
|
|
thanks , i will try this
|
|
|
|
|
I am using datatable in my application to show the data in gridview.Now what I want is that when user enter a new line application should check the datatable.if the record exists then it should show a warning otherwise add a new row in datatable.
I am using the following code to check the datatable through loop.
Dim x As DataRow
For Each x In mydatatable.Rows
If x.Item(1).ToString = Me.TextBox1.Text Then
Me.Label1.Text = "Exist"
End If
Next
With the above code I am getting error 'Object reference not set to an instance of an object.' at the first row of the for loop
Ejaz
Ejaz
|
|
|
|
|
ejaz_pk wrote: If x.Item(1).ToString = Me.TextBox1.Text Then
I think this line is causing the issue. Does your datatable has column 1?
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
Here is coding for the application
I am getting error message when click on button1_click event
Imports System.Data
Imports System.Data.OleDb
Partial Class _Default
Inherits System.Web.UI.Page
Dim MYDT As DataTable
Dim mydatatable As DataTable
Private Function CreateDataTable() As DataTable
mydatatable = New DataTable()
Dim myDataColumn As DataColumn
myDataColumn = New DataColumn()
myDataColumn.DataType = Type.GetType("System.String")
myDataColumn.ColumnName = "id"
myDataTable.Columns.Add(myDataColumn)
myDataColumn = New DataColumn()
myDataColumn.DataType = Type.GetType("System.String")
myDataColumn.ColumnName = "username"
myDataTable.Columns.Add(myDataColumn)
myDataColumn = New DataColumn()
myDataColumn.DataType = Type.GetType("System.String")
myDataColumn.ColumnName = "firstname"
myDataTable.Columns.Add(myDataColumn)
myDataColumn = New DataColumn()
myDataColumn.DataType = Type.GetType("System.String")
myDataColumn.ColumnName = "lastname"
myDataTable.Columns.Add(myDataColumn)
Return myDataTable
End Function
Private Sub AddDataToTable(ByVal username As String, ByVal firstname As String, ByVal lastname As String, ByVal myTable As DataTable)
Dim row As DataRow
row = myTable.NewRow()
row("id") = Guid.NewGuid().ToString()
row("username") = username
row("firstname") = firstname
row("lastname") = lastname
myTable.Rows.Add(row)
End Sub
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load
If Me.IsPostBack = False Then
MYDT = New Data.DataTable()
MYDT = CreateDataTable()
Session("myDatatable") = MYDT
Me.GridView1.DataSource = (CType(Session("myDatatable"), Data.DataTable)).DefaultView
Me.GridView1.DataBind()
End If
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If Me.TextBox1.Text.Trim() = "" Then
Me.Label1.Text = "You must fill a username."
Return
Else
Dim x As DataRow
For Each x In mydatatable.Rows
If x.Item(1).ToString = Me.TextBox1.Text Then
Me.Label1.Text = "Exist"
End If
Next
AddDataToTable(Me.TextBox1.Text.Trim(), Me.TextBox2.Text.Trim(), Me.TextBox3.Text.Trim(), CType(Session("myDatatable"), DataTable))
Me.GridView1.DataSource = CType(Session("myDatatable"), DataTable).DefaultView
Me.GridView1.DataBind()
Me.TextBox1.Text = ""
Me.TextBox2.Text = ""
Me.TextBox3.Text = ""
Me.Label1.Text = ""
Me.TextBox1.Focus()
End If
End Sub
End Class
-- modified at 5:43 Wednesday 15th August, 2007
|
|
|
|
|
You have several issues here
1 - you're giving all your variables names that obsfucate your code. Give them real names
2 - you need to learn how to use the debugger, you should set a break point or two in your code, and examine your data source to see what's going wrong
3 - you have two datatables as members, called MYDT and myDataTable ( or something ). More bad naming
4 - SQL is what you use to filter a data source. What you're doing is not the right way to go about filtering data.
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 )
|
|
|
|
|
Thanks Christian for reply. Actually this is my test code and not using in the application. This is my first test by using datatable in asp.net
|
|
|
|
|
hi all
i m having a class like
public class c1
end class
now what i m trying to do is
public class c1
'some code
public class c2
'some code
end class
end class
how can i use the class c2, at this movement the class c2 is not executing,
how can i execute it. i also tryed
i m having a class like
public class c1
end class
now what i m trying to do is
public class c1
public sub new()
private _c2 as new c1
end sub
'some code
public class c2
'some code
end class
end class
but this one generates an unexpected error that crashes the vb.net
can some one tell what is worng with it and how can i use this sub class.
the main class is a control, and the sub class is another control that i m trying to place on the main class's control( also contain some events that force the control to move on the main control )
thnx
help everyone
|
|
|
|
|
The questions is....
how you declared a private variable in that position?
A.E.K
|
|
|
|
|
can u describe it in more detail. i just can't understand what u r trying to say.
thnx
help everyone
|
|
|
|