|
Just starting and stopping the timer will not cause any delay. You have to use the Tick event of the timer to wait for the first interval.
---
b { font-weight: normal; }
|
|
|
|
|
Hi
Thanks for ur rep. I am new to vb so as you said do i need to use that code in timer tick event or something else
wating for ur rep.
thanks
|
|
|
|
|
On top of that, your login form should NOT be your startup form. Make you main application form the startup form. In it's Form_Load event, create and start your Login form. Once that is complete you can use the information from that form however you wish in your code.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
in crystal report i want to display the data in column manner
like this
Name School College Name School College
xyz abc pqr xyz abc pqr
rrr eee eee rrr eee eee
how to do it?
|
|
|
|
|
Your question is not so clear. If you want to show same data with two columns, you should put same column right side again. but
if you want to show different data with two columns then you should use
'Format with multiple columns'in Detail area of report. it creates multiple column in your report. In this type of formating after filling one column it fills another coloumn. please try this.
|
|
|
|
|
I had tried that one but it will not come in multiple column like this
name school name school
kkk llll jjjj iiii
for doing that did we need registered version of Crystal report
|
|
|
|
|
I'm trying to use a PropertyGrid to let the user quickly edit a class' property. In order to do this in the better way possible, I'm using tags like this in the class' properties:
Private mText As String
<description("bla bla="" bla")=""> _
<editor(gettype(system.componentmodel.design.multilinestringeditor), gettype(system.drawing.design.uitypeeditor))=""> _
Public Property Text() As String
Get
Return mText
End Get
Set(ByVal value As String)
mText = value
End Set
End Property
However, the compiler always tells me there is no definition for System.ComponentModel.Design.MultilineStringEditor. This seems strange, since I've browsed many sites and they were using the same exact line of codes. I've also included these namespaces, but with no success:
Imports System.ComponentModel.Design
Imports System.ComponentModel
Imports System.Drawing.Design
Imports System.Drawing.Design.UITypeEditor
..maybe do I need to add some reference to the project? Otherwise, where am I wrong?
|
|
|
|
|
Hello,
to use this editor, you need to add the System.Design.dll as a reference to your project.
|
|
|
|
|
Thank you! It works now
|
|
|
|
|
hi gyes, the following is an insert statement which contains an error of missing comma, but I don't know where is the missing of the comma:
Dim q As String
q = "insert into user_proj_trans(user_index,proj_code,proj_trns,user_expired_time) " & _
" values(" & UIndex & "," & PC & "," & PT & "," & "'to_char(UTime,'dd-mon-yyyy')'" & ")"
and the UIndex, PC, PT, and UTime are defined before, and the UTime is of Date datatype.
|
|
|
|
|
what are the data types of those fields(in the data base)
user_index, proj_code, proj_trns, user_expired_time
if thay are containg chars then you should put them inside ''
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
The only field which need " is the user_expired_time field and I put " with this field, but the erro here is an error of missing comma
|
|
|
|
|
Either way, you'd do better to use parameterised queries or, better yet, stored procs.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
"'to_char(UTime,'dd-mon-yyyy')'"
Are the first and last ' in this correct ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
you know if we write our insert statement by putting a static Date like:
q = "insert into user_proj_trans(user_index,proj_code,proj_trns,user_expired_time) " & _
" values(" & UIndex & "," & PC & "," & PT & "," & "'30-dec-2007'" & ")"
the last statement will be correct and I tried it.
but I need to read the date from the screen using the variable UTime which is the value reurned by selecting from a DateTimePicker object....So I need to convert the UTime value into the correct format that is like:
"'30-dec-2007'"
and I tried that using to_char function but it did not work
|
|
|
|
|
The comma is missing after the string 'to_char(UTime,' . As you have apostrophes inside the string, the string ends at the first apostrophe.
I imagine that you don't want to put the literal string "to_char(UTime,'dd-mon-yyyy')" in the user_expired_time field, but rather that the function to_char should be used to create a date value for the field. Then you should not put the function call inside a string, but concatenate the return value of the function with the other strings.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
u can use parameteraized Query like:
dim cmd as new sqlcommand
cmd.commandtext="insert into user_proj_trans(user_index,proj_code,proj_trns,user_expired_time) values (@user_index,@proj_code,@proj_trns,@user_expired_time)"
cmd.parameters.add(@user_index,UIndex)
cmd.parameters.add(@proj_code,PC )
cmd.parameters.add(@proj_trns,PT )
cmd.parameters.add(@user_expired_time,UTime)
cmd.connection.open
cmd.executenonquery
cmd.connection.close
this is maybe better than u had wrote ,
Mohamad A. Flefel
mflefel@hotmail.com
+962 79 5963865
C#.net & VB.net Developer
|
|
|
|
|
I think your query should read:
q = "insert into user_proj_trans(user_index,proj_code,proj_trns,user_expired_time) " & _
" values(" & UIndex & "," & PC & "," & PT & ",'" & to_char(UTime,"dd-mon-yyyy") & "')"
|
|
|
|
|
Hi gyes,
I realy tried all of your advices, but no one has solved the problem. and finalla I think there is another problem which is represented in an Oracle problem which is:ORA-00932: inconsistent datatypes: expected Date got number
we need to know whats the function that converts the String or the Character into a Data datatype to stored correctly in the DataBase.
there is a function called "Convert" which may help but also it did not work
please any body has an idea to solve the problem, I will be very appreciative
kind regards
|
|
|
|
|
Hi all,
I have a sorted, non-editable DataGridView which contains some cells in each row that are traffic-lighted (ie: they have a different b/g colour depending on value) but when I populate the control the row that was the first one (before sorting) is always highlighted thus wiping out my custom coloured cells. I have tried every combo of colours and highlighting options to try and stop the DGV doing this but can't find a way. Ideally I just want to suppress altogether the DGV control selecting a row when it populates - does anyone know how I can go about this?
This is driving me mad so I hope someone can help!
TIA...
Mike
|
|
|
|
|
There should be an option where readonly means "for use as display only no selection please".
I got this effect in a recent project by deselecting everything just after the DataGridView was populated.
The Deslection:
Private Sub DeselectGridRows(ByVal dgv As DataGridView)
Dim dgr As DataGridViewRow
For Each dgr In dgv.SelectedRows
dgr.Selected = False
Next
End Sub
Deselecting called form within the forms load event:
Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
Windows.Forms.Cursor.Current = Cursors.WaitCursor
Me.SuspendLayout()
PopulateDataGridView(dgv)
DeselectGridRows(dgv)
Me.ResumeLayout()
Windows.Forms.Cursor.Current = Cursors.Default
End If
End Sub
|
|
|
|
|
Thanks Leah.... actually I'm not sure why I even posted the question as I realised soon after all you need to do is say datagridview1.SelectedRows(0).Selected = false and that takes care of it.
What I want to do now is only highlight a row when the user clicks on one but rather than using a background colour (which obscures my cell traffic-lighting) I want to leave the B/G and F/G colours as they are and instead draw a 2-pixel red border around the entire row - and I'm thinking the only way to do that is to override one of the Paint methods... anyone know of a better/simpler way?
|
|
|
|
|
This is proably an old thread now and past it's sell by date, but I did put an article in about drawing cell colours that may or may not help. Search the articles for 'Couluring and centering cells in datagridview' - Yes it contains a typo that got uploaded to the web!
David Loring
!! Keep Music Live !!
|
|
|
|
|
I'm sure it's been covered by many articles, but i'd like some direct help. I'm trying to write a simple Database program with a few fields, an autoincrement customer number etc. I used the easy vs way to develop my form, i built a database, connected it to my program then dragged and dropped the details version of my customers data table, it went ahead and created its navigation bar and what-not.
All sounds good so far, except when i run it. When I run the program, add, edit and then click save data, nothing happens, i mean it thinks for a moment, but when i shutdown the program and restart, all the data i changed or created has just disappeared. Has anyone had similar problem or can anyone suggest solution or even run me through how you would design a database driven program.
I am using Visual Studio 2005 and SQL Server 2005, database is customers.mdf
Thanks in advance.
Posted by The ANZAC
|
|
|
|
|
If you post some of your code, especially the onClick event of the save button on you navigation bar.
|
|
|
|