|
I tried it..But still i am getting the same error..
Regards,
Balaguru
|
|
|
|
|
You must still be doing something wrong. Post your code.
Paul
|
|
|
|
|
Balagurunathan S wrote: Private Sub btnRerun_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRerun.Click
mstrjobid = Me.DataGrid1.Item(DataGrid1.CurrentRowIndex, 0)
MsgBox(mstrjobid)
End Sub
OK. So where does mstrjobid get defined?? What does that code look like??
I get the feeling that it's defined as a String and not Guid like it should be.
If that's the case, then yes, you'll get the error that you're seeing because you're trying to assign a Guid object to a variable declared as String.
But, to get your code "working",
mstrjobid = DataGrid1.Item(DataGrid1.CurrentRowIndex, 0).ToString()
|
|
|
|
|
Hi Dave..
Thanks very much for the help.I got it right..Thanks for all who replied for this post..
Regards,
Balaguru
|
|
|
|
|
i have boolean.. and if FALSE then i want the context menu to have
add
edit
delete
if TRUE then just
edit
delete
i have some other scenarios that will be similar to this...
anyone know a good way to approach this?
Thanks for your time
red
|
|
|
|
|
Create a context menu with all three menu items. Then at run time you may set visible property of Add menu item to false by checking the value of Boolean variable.
Such as-
----------------------
If bln = True Then
Me.AddToolStripMenuItem.Visible = False
End If
--------------------
I hope this helps .
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Me.AddToolStripMenuItem.Visible = Not myBoolean
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
|
|
|
|
|
cool thanks
|
|
|
|
|
thanks dave, thatll do it. simpler than what i thought i had to do..
nice one, cheers
red
|
|
|
|
|
hi i'm stell new to vb.net & i have this error message i just want to know what dose it mean??
" unhandled exception of type 'System.FormatException' occurred in system.data.dll
Additional information: Input string was not in a correct format
i'll copy the code to you to see with me(
<b>Imports System.Data.SqlClient
Public Class branch_code
Inherits System.Windows.Forms.Form
Private Sub b_save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_save.Click
' Declear paramter
Dim par1 As New SqlParameter("@branchid", SqlDbType.Int, 4)
par1.Direction = ParameterDirection.Input
cm_pink.Parameters.Add(par1)
''Set values for all poarameters
par1.Value = tb_branch_id.Text
''set command text
cm_pink.CommandText = "insert into Branch ([Branch Name])" & _
"values (@branchname)"
'---------------------------
If tb_branch_name.Text = "" Then
Error_name.SetError(tb_branch_name, "Please Insert Name Here ")
Else
End If
check_connetion()
cm_pink.ExecuteScalar()
' Dim count As Integer
'count =
' StatusBar1.Text = CStr(count) & " Row Inserted "
cn_pink.Close()
cm_pink.Dispose()
cm_pink.Parameters.Clear()
End Sub
Private Sub b_clear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_clear.Click
clear(Me)
End Sub
Private Sub b_Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b_Cancel.Click
Me.Close()
End Sub
Private Sub branch_code_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class)
thanks for any helpe
Hend alraie
-- modified at 7:06 Tuesday 25th September, 2007
|
|
|
|
|
Which line gives the error ?
I do think you need a space between ) and the v in values.
I also see that the parameter you're adding is branchid, not branchname.
Overall, I'd say if you're new to VB.NET, you should not be working on this code, unless you have a background in C#.
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 )
|
|
|
|
|
the error in this line
cm_pink.ExecuteScalar()
|
|
|
|
|
nowdy wrote: cm_pink.CommandText = "insert into Branch ([Branch Name])" & _
"values (@branchname)"
This is the problem with concantenating string together. Like Christian pointed out, you're missing a space between the ")" and "values" in your resulting string, which looks something like this:
insert into Branch ([BranchN Name])values (@branchname)
which, in SQL, is a problem. There must be a space just before "values".
|
|
|
|
|
nowdy wrote: par1.Value = tb_branch_id.Text
Your other issue is this line. You might want to try validating the entered text AND convert it to an Integer before you try and assign it to the parameter value.
Dim branchId As Integer
If Integer.TryParse(tb_branch_id.Text, branchId) Then
' Create your parameter object and assign the value of
' branchId to it's Value property.
' Then you can do your query
End If
If the TryParse statement returns False, the text entered could not be converted to an Integer, invalidating your SQL lookup.
|
|
|
|
|
thank you Mr very mush i think that will help
& if i needed any thing i'll send you
best wishes
|
|
|
|
|
hello!!
i have to calculate difference of minutes in the samedate i used datediff function but it gives me wrong result
the syntax that i m using for datediff is as
datediff("n", dateval & " " & time1val ,dateval & " " & time2val)
plz help me out!!!
any sort of help will be highly appreciated
|
|
|
|
|
look into the timespan object
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
thanks a lot
it works fine with timespan
regards
|
|
|
|
|
Hi,
using VB .NET 2005, we have a ListView control and sometimes when there is no space left, scrollbars appears. What we need to do is to change the color of the scrollbars. For example to make them red. Any idea on how to do that ?
nink
|
|
|
|
|
There are no properties for the scrollbars in the standard controls. They render themselves using the colors define in the Display Properties control panel, under the Appearance tab.
You can replace the control's scrollbar with your own custom implementation, but is it really worth it??[^]
|
|
|
|
|
|
Hi i have a form and i put validation controls(required field validator ) to many controls..
and causes validation is true for the submit button..
On the local its working properly but when the upload te page online its giving error
"Object reference not set to an instance of an object. "
Its not performing the validations...
can some one help me out please
Hepsy
|
|
|
|
|
are you doing in asp.net
if yes then you are in wrong forum
if no then I dont understand how you can just upload one page in Desktop application?
Paras Kaneriya The difference between genius and stupidity is that genius has its limits.
|
|
|
|
|
hepsy.i wrote: "Object reference not set to an instance of an object. "
This means that you're trying to use an object that your code assumed it either created or retrieved sucessfully. You're trying to do something like this:
Nothing.SomeMethod()
or
Nothing.SomeProperty = someValue
You can use a Nothing object...
|
|
|
|
|
Thank you Dave ..
But the problem is...............
I put validations(required field validators) for all the textbox....
when i click submit button......
its giving this error...
the first thing it should do is validations ......
and the first statement in the button submit event is page.validate()
but still it gives this error
"System.NullReferenceException: Object reference not set to an instance of an object."
Please help me
i'm not familiar with this
Hepsy
|
|
|
|