Showing posts with label form. Show all posts
Showing posts with label form. Show all posts

Wednesday, March 28, 2012

manage exception message

How to manage sql server runtime message to users understand it?

In my web form I added folowed code

If Session("Action") = "Edit" Then

Try

ObjectDataSource1.Update()

Catch ex As Exception

lblMessage.Text = ex.GetBaseException.Message

End Try

for manage user input for update the record.

This is message returned by sql server 2005

The UPDATE statement conflicted with the REFERENCE constraint "FK_DEVIZE_RELATION__DRZAVE". The conflict occurred in database "Trgo2006", table "dbo.Devize", column 'Drzava'. The statement has been terminated

This message not understand for users. How to manage messages retrned by sql server, or prepare exception to return message understanded for users.

YOu could build a generic wrapper class for Sqlexceptions like this one mentioned here:

http://weblogs.asp.net/guys/archive/2005/05/20/408142.aspx

HTH, jens Suessmeyer.

http://www.sqlserver2005.de

Monday, March 26, 2012

Making field read only

Goodday all

I have a details view on a vb form .

Now that i have been working on the program , i realise that i would like to make some fields " read only '

Is that possible , and if so how?

Thanks

Rob

You could:

1 - Set permissions in SQL Server for SELECT only.
2. -Set the form properties to 'Read Only' (Enabled = False) for that textbox.

sql

Wednesday, March 21, 2012

make table cell text - BOLD

hi there, i have question..i have a table which i fill with data form
a database...
Col1 Col2 Col3
---
=Fields!.. =Fields!... =Fields!
Col1 is filled with some text and has like 15 rows, and Col2 and Col3
are its values...So my question is - is it possible to have certain
values from Col1 to be BOLD, for example i want to have the fourth and
sixth row value for Col1 to be BOLD text...
THNX!Maybe you can place each of your 15 rows in Col1 in one detail row in your
table, so you can apply specific format in every separated row.
Does it help?
"ApeX" <jkdmaster_5@.hotmail.com> escribió en el mensaje
news:1187248049.501166.88240@.19g2000hsx.googlegroups.com...
> hi there, i have question..i have a table which i fill with data form
> a database...
> Col1 Col2 Col3
> ---
> =Fields!.. =Fields!... =Fields!
>
> Col1 is filled with some text and has like 15 rows, and Col2 and Col3
> are its values...So my question is - is it possible to have certain
> values from Col1 to be BOLD, for example i want to have the fourth and
> sixth row value for Col1 to be BOLD text...
> THNX!
>|||On Aug 16, 3:07 am, ApeX <jkdmaste...@.hotmail.com> wrote:
> hi there, i have question..i have a table which i fill with data form
> a database...
> Col1 Col2 Col3
> ---
> =Fields!.. =Fields!... =Fields!
> Col1 is filled with some text and has like 15 rows, and Col2 and Col3
> are its values...So my question is - is it possible to have certain
> values from Col1 to be BOLD, for example i want to have the fourth and
> sixth row value for Col1 to be BOLD text...
> THNX!
Try inserting this expression into the FontWeight property for the
cell you want:
=IIF(RowNumber(nothing) = 4 or RowNumber(nothing) = 6, "Bold",
"Normal")
That should work
toolman|||Your not going to be able to do it particularly gracefully if there's no
logic behind the decision.
What you can do is us a custom code block and put an expression on the
FontWeight property of yuor column.
Public Function GetFontWeight( _
ByVal columnValue As String) As String
If columnValue = "Col1" Or columnValue = "Col2 Then Return "Bold"
Return "Normal"
End Function
Expression on FontWeight property:
=Code.GetFontWeight(Fields!YourColumn.Value)
Joe
"ApeX" wrote:
> hi there, i have question..i have a table which i fill with data form
> a database...
> Col1 Col2 Col3
> ---
> =Fields!.. =Fields!... =Fields!
>
> Col1 is filled with some text and has like 15 rows, and Col2 and Col3
> are its values...So my question is - is it possible to have certain
> values from Col1 to be BOLD, for example i want to have the fourth and
> sixth row value for Col1 to be BOLD text...
> THNX!
>|||To follow up with what Joe said, if you have logic that determines which rows
you want bold it is possible. Simply put that logic in the FontWeight
property of the cell (either using the custom code joe suggested or a simple
IIF statement). You will, however, have to bold the entire contents of that
cell. You won't be able to just bold certain words (wasn't sure if this was
your question).
Hope this helps...
"Joe" wrote:
> Your not going to be able to do it particularly gracefully if there's no
> logic behind the decision.
> What you can do is us a custom code block and put an expression on the
> FontWeight property of yuor column.
> Public Function GetFontWeight( _
> ByVal columnValue As String) As String
> If columnValue = "Col1" Or columnValue = "Col2 Then Return "Bold"
> Return "Normal"
> End Function
> Expression on FontWeight property:
> =Code.GetFontWeight(Fields!YourColumn.Value)
> Joe
> "ApeX" wrote:
> > hi there, i have question..i have a table which i fill with data form
> > a database...
> >
> > Col1 Col2 Col3
> > ---
> > =Fields!.. =Fields!... =Fields!
> >
> >
> > Col1 is filled with some text and has like 15 rows, and Col2 and Col3
> > are its values...So my question is - is it possible to have certain
> > values from Col1 to be BOLD, for example i want to have the fourth and
> > sixth row value for Col1 to be BOLD text...
> >
> > THNX!
> >
> >