|
You could use something like:
\d+(-\d+)?(,\d+(-\d+)?)*
That will still only validate the format, not the sanity of the range. A string like "45-3,12-14,13,13,0,0,0,0" would still be valid.
---
b { font-weight: normal; }
|
|
|
|
|
|
I have commented out some code but when I run my app the commented code is still throwing an error.
The error that I get is "Object reference not set to an instance of an object."
I get this same error when the code is uncommented. My app stops at the commented code with the error.
anyone any ideas.
Thanks.
|
|
|
|
|
compile the supposed commented code.
|
|
|
|
|
|
I have drawn an undee chart on a panel dynamically.I use a scrollbar.it is used to read fore chart.And what i want to get help is:
what do you think the best way to achieve it.
ICQ:258-235-734
-- modified at 4:32 Thursday 11th May, 2006
|
|
|
|
|
Hello,
I have populated my dataset SQLDataset, and would like to pass the data to a table in SQL Server 7.0. How do I accomplish this?
<br />
Private Sub cmdExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExport.Click<br />
<br />
Dim DBConnection As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\db1.mdf" & _<br />
";Integrated Security=True;User Instance=True")<br />
Dim SQLDataset As New DataSet("db1") <br />
Dim currentUser As String<br />
Dim trimUserName As String<br />
currentUser = My.User.Name<br />
<br />
trimUserName = My.User.Name.ToUpper.ToString()<br />
currentUser = trimUserName.Substring(9)<br />
<br />
DBConnection.Open() 'open database<br />
<br />
Dim dbAdapter As New SqlDataAdapter("SELECT * FROM tblContacts WHERE Status = 'NEW'", DBConnection)<br />
<br />
dbAdapter.Fill(SQLDataset) <br />
<br />
If SQLDataset.Tables("Table").Rows(0)(14).ToString = "NEW" Then<br />
<br />
'then send data to SQL Server 7.0<br />
<br />
<br />
End If<br />
<br />
SQLDataset.WriteXml("c:\temp\" & currentUser & ".xml", XmlWriteMode.WriteSchema)<br />
DBConnection.Close()<br />
<br />
<br />
<br />
<br />
End Sub<br />
|
|
|
|
|
Hi! there,
Im having a project to develop a library management system.
But i have no idea where to start.
P'se help me people where necessary.
Thanx
|
|
|
|
|
|
Have you studied Software Project yet?
Maybe it is useful to you.
Adair
|
|
|
|
|
Well what i studied is introduction to VB 6.0 only.
And i know about software re engineering.
What i dont know is how to develop this software using VB.
P'se help me. I can even send the interface i design for that library management system.
Thanx
|
|
|
|
|
hi there ,
I am trying to wrap all the rpoject file to setup file . how to do that in vb.net (2003)
thanks in advance.
bharath.s
|
|
|
|
|
http://msdn2.microsoft.com/en-us/library/2kt85ked(vs.80).aspx
Adair
|
|
|
|
|
Is there anything i have to Consider it befor,output msg from thread to label windows control ?
because i made code but it give me this exception->(Cross-thread operation not valid: Control 'Label1' accessed from a thread other than the thread it was created on.)
i want to know why exactly this?,also what solution for it?
|
|
|
|
|
|
is there any simple example doing this?
|
|
|
|
|
' This is an example from msdn of microsoft
Imports System
Imports System.ComponentModel
Imports System.Threading
Imports System.Windows.Forms
Public Class Form1
Inherits Form
' This delegate enables asynchronous calls for setting
' the text property on a TextBox control.
Delegate Sub SetTextCallback([text] As String)
' This thread is used to demonstrate both thread-safe and
' unsafe ways to call a Windows Forms control.
Private demoThread As Thread = Nothing
' This BackgroundWorker is used to demonstrate the
' preferred way of performing asynchronous operations.
Private WithEvents backgroundWorker1 As BackgroundWorker
Private textBox1 As TextBox
Private WithEvents setTextUnsafeBtn As Button
Private WithEvents setTextSafeBtn As Button
Private WithEvents setTextBackgroundWorkerBtn As Button
Private components As System.ComponentModel.IContainer = Nothing
Public Sub New()
InitializeComponent()
End Sub
Protected Overrides Sub Dispose(disposing As Boolean)
If disposing AndAlso Not (components Is Nothing) Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
' This event handler creates a thread that calls a
' Windows Forms control in an unsafe way.
Private Sub setTextUnsafeBtn_Click( _
ByVal sender As Object, _
ByVal e As EventArgs) Handles setTextUnsafeBtn.Click
Me.demoThread = New Thread( _
New ThreadStart(AddressOf Me.ThreadProcUnsafe))
Me.demoThread.Start()
End Sub
' This method is executed on the worker thread and makes
' an unsafe call on the TextBox control.
Private Sub ThreadProcUnsafe()
Me.textBox1.Text = "This text was set unsafely."
End Sub
' This event handler creates a thread that calls a
' Windows Forms control in a thread-safe way.
Private Sub setTextSafeBtn_Click( _
ByVal sender As Object, _
ByVal e As EventArgs) Handles setTextSafeBtn.Click
Me.demoThread = New Thread( _
New ThreadStart(AddressOf Me.ThreadProcSafe))
Me.demoThread.Start()
End Sub
' This method is executed on the worker thread and makes
' a thread-safe call on the TextBox control.
Private Sub ThreadProcSafe()
Me.SetText("This text was set safely.")
End Sub
' This method demonstrates a pattern for making thread-safe
' calls on a Windows Forms control.
'
' If the calling thread is different from the thread that
' created the TextBox control, this method creates a
' SetTextCallback and calls itself asynchronously using the
' Invoke method.
'
' If the calling thread is the same as the thread that created
' the TextBox control, the Text property is set directly.
Private Sub SetText(ByVal [text] As String)
' InvokeRequired required compares the thread ID of the
' calling thread to the thread ID of the creating thread.
' If these threads are different, it returns true.
If Me.textBox1.InvokeRequired Then
Dim d As New SetTextCallback(AddressOf SetText)
Me.Invoke(d, New Object() {[text]})
Else
Me.textBox1.Text = [text]
End If
End Sub
' This event handler starts the form's
' BackgroundWorker by calling RunWorkerAsync.
'
' The Text property of the TextBox control is set
' when the BackgroundWorker raises the RunWorkerCompleted
' event.
Private Sub setTextBackgroundWorkerBtn_Click( _
ByVal sender As Object, _
ByVal e As EventArgs) Handles setTextBackgroundWorkerBtn.Click
Me.backgroundWorker1.RunWorkerAsync()
End Sub
' This event handler sets the Text property of the TextBox
' control. It is called on the thread that created the
' TextBox control, so the call is thread-safe.
'
' BackgroundWorker is the preferred way to perform asynchronous
' operations.
Private Sub backgroundWorker1_RunWorkerCompleted( _
ByVal sender As Object, _
ByVal e As RunWorkerCompletedEventArgs) _
Handles backgroundWorker1.RunWorkerCompleted
Me.textBox1.Text = _
"This text was set safely by BackgroundWorker."
End Sub
#Region "Windows Form Designer generated code"
Private Sub InitializeComponent()
Me.textBox1 = New System.Windows.Forms.TextBox()
Me.setTextUnsafeBtn = New System.Windows.Forms.Button()
Me.setTextSafeBtn = New System.Windows.Forms.Button()
Me.setTextBackgroundWorkerBtn = New System.Windows.Forms.Button()
Me.backgroundWorker1 = New System.ComponentModel.BackgroundWorker()
Me.SuspendLayout()
'
' textBox1
'
Me.textBox1.Location = New System.Drawing.Point(12, 12)
Me.textBox1.Name = "textBox1"
Me.textBox1.Size = New System.Drawing.Size(240, 20)
Me.textBox1.TabIndex = 0
'
' setTextUnsafeBtn
'
Me.setTextUnsafeBtn.Location = New System.Drawing.Point(15, 55)
Me.setTextUnsafeBtn.Name = "setTextUnsafeBtn"
Me.setTextUnsafeBtn.TabIndex = 1
Me.setTextUnsafeBtn.Text = "Unsafe Call"
'
' setTextSafeBtn
'
Me.setTextSafeBtn.Location = New System.Drawing.Point(96, 55)
Me.setTextSafeBtn.Name = "setTextSafeBtn"
Me.setTextSafeBtn.TabIndex = 2
Me.setTextSafeBtn.Text = "Safe Call"
'
' setTextBackgroundWorkerBtn
'
Me.setTextBackgroundWorkerBtn.Location = New System.Drawing.Point(177, 55)
Me.setTextBackgroundWorkerBtn.Name = "setTextBackgroundWorkerBtn"
Me.setTextBackgroundWorkerBtn.TabIndex = 3
Me.setTextBackgroundWorkerBtn.Text = "Safe BW Call"
'
' backgroundWorker1
'
'
' Form1
'
Me.ClientSize = New System.Drawing.Size(268, 96)
Me.Controls.Add(setTextBackgroundWorkerBtn)
Me.Controls.Add(setTextSafeBtn)
Me.Controls.Add(setTextUnsafeBtn)
Me.Controls.Add(textBox1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub 'InitializeComponent
#End Region
<stathread()> _
Shared Sub Main()
Application.EnableVisualStyles()
Application.Run(New Form1())
End Sub
End Class
Adair
|
|
|
|
|
is this simple example ? if yes , what about complex one hehehe
i searched befor , i found MSDN example but it is so long, what i want is real simple example because i dont have time for my project.
|
|
|
|
|
hi there ,
how to add the controls while the loading of the form . the number of each and every control will be dynamic.
thanks in advance.
bharath.s
|
|
|
|
|
write code when you want to add
Adair
|
|
|
|
|
Dim Lbl(1 As Label
Lbl1 = New Label()
With Lbl1
.SendToBack()
.AutoSize = True
.Location = New System.Drawing.Point(iX, iY)
.Text = finsSubjReg.dsStudCls.Tables(0).Rows(iCtr).Item("cls_type_code")
End With
Me.Controls.Add(Lbl1)
raj
|
|
|
|
|
im using acces 2000 as my database and i need to search
some words. but to search i have to use exact case as i input it.
anyone know sql statement to query with case insensitive ?
|
|
|
|
|
Your subject says "case insensitive" but your post asks about "case sesitive" - which do you want?
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
i want to search with case insensitive but right now i only know how to search case sensitive.
|
|
|
|
|
as has been suggested below, if you change the input to lowercase, and the database value to lowercase - you have a case insenitive search.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|