Click here to Skip to main content
15,896,912 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionwhich font is suitable for dotmatrix printer? Pin
JC.KaNNaN26-Jun-09 19:05
JC.KaNNaN26-Jun-09 19:05 
AnswerRe: which font is suitable for dotmatrix printer? Pin
Christian Graus26-Jun-09 20:22
protectorChristian Graus26-Jun-09 20:22 
GeneralRe: which font is suitable for dotmatrix printer? Pin
JC.KaNNaN26-Jun-09 22:28
JC.KaNNaN26-Jun-09 22:28 
GeneralRe: which font is suitable for dotmatrix printer? Pin
Rajesh Anuhya26-Jun-09 23:21
professionalRajesh Anuhya26-Jun-09 23:21 
GeneralRe: which font is suitable for dotmatrix printer? Pin
JC.KaNNaN27-Jun-09 2:28
JC.KaNNaN27-Jun-09 2:28 
GeneralRe: which font is suitable for dotmatrix printer? Pin
Henry Minute27-Jun-09 10:45
Henry Minute27-Jun-09 10:45 
GeneralRe: which font is suitable for dotmatrix printer? Pin
Rajesh Anuhya27-Jun-09 19:16
professionalRajesh Anuhya27-Jun-09 19:16 
QuestionProblem with checkboxes not saving to SQL as Boolean Pin
FthrJACK26-Jun-09 10:36
FthrJACK26-Jun-09 10:36 
Hi, i have a form with text boxes for username, initials, and password on.
Also on this form are a few checkboxes which at the minute i simply want to save their state to SQL as true or false depending if ticked or not. The checkboxes or text boxes are not bound to anything, and are used only for creating a new record in the table.

There is a gridview below these boxes showing already created records.

The code im using to insert to SQL with is:

If String.IsNullOrEmpty(UsernameTb.Text) Then
            MsgBox("You must enter a Username!")
        Else
            If String.IsNullOrEmpty(InitialsTb.Text) Then
                MsgBox("You must enter users Initials!")
            Else
                If String.IsNullOrEmpty(PasswordTb.Text) Then
                    MsgBox("You must enter a Password!")
                Else
                    Try
                        Me.UsersTableAdapter.AddUserQry(UsernameTb.Text, InitialsTb.Text, PasswordTb.Text, ApplicationsChkbx.Checked, AdministrationChkBx.Checked, CustomerSearchChkBx.Checked, CustomerFormChkbx.Checked, UnderWrittingChkBx.Checked)
                        
'Update the Gridview and notify account created
                        Me.UsersTableAdapter.Fill(Me.WDA_SQLDataSet.Users)
                        MsgBox("Created user " & UsernameTb.Text)

'Empty all the text boxes and set check boxes back to unticked state
                        

                        UsernameTb.Text = Nothing
                        InitialsTb.Text = Nothing
                        PasswordTb.Text = Nothing
                        AdministrationChkBx.CheckState = 0
                        ApplicationsChkbx.CheckState = 0
                        CustomerFormChkbx.CheckState = 0
                        CustomerSearchChkBx.CheckState = 0
                        UnderWrittingChkBx.CheckState = 0

                    Catch ex As Exception
                        MsgBox("Error will robinson, error")
                    End Try
                End If
            End If
        End If



"AddUserQry" is a Query on the dataset for that table:

INSERT INTO [Users] ([Username], [Initials], [Password], [Applications_Access], [Administration_Access], [CustomerSearch_Access], [CustomerForm_Access], [Underwritting_Access]) VALUES (@Username, @Initials, @Password, @Applications_Access, @Administration_Access, @CustomerSearch_Access, @CustomerForm_Access, @Underwritting_Access);
SELECT ID, Username, Initials, Password, Applications_Access, Administration_Access, CustomerSearch_Access, CustomerForm_Access, Underwritting_Access FROM Users WHERE (ID = SCOPE_IDENTITY())


For some reason when i create a new record, it saves the check state as -1 for checked, and 0 for unchecked. the table columns are varchar(5) for the check boxes.

Using checkboxname.checkstate doesent work either - that saves the state as 1 or 0 (as opposed to -1 and 0)

On another form i made for editing existing entries, i have the same text boxes and check boxes, which are bound so they show the record details. when using that form to EDIT an entry, it saves the check box states as "True" or "False" as it should do.

Im completely stumped here, because if i create a new user it then breaks the gridview showing users, because it throws up error messages about "-1 not being valid boolean" when it attempts to render each check box in a grid view.

Has anyone got any ideas why this is happening? and how i can make the insert save the check box state as boolean? im losing sleep over this one, litteraly!

any help/suggestions much appreciated Smile | :)
AnswerRe: Problem with checkboxes not saving to SQL as Boolean Pin
Henry Minute26-Jun-09 10:52
Henry Minute26-Jun-09 10:52 
GeneralRe: Problem with checkboxes not saving to SQL as Boolean Pin
FthrJACK26-Jun-09 22:39
FthrJACK26-Jun-09 22:39 
AnswerRe: Problem with checkboxes not saving to SQL as Boolean Pin
FthrJACK27-Jun-09 4:22
FthrJACK27-Jun-09 4:22 
QuestionSPCONTROL.GetContextWeb(Context).Web("whatever") & WithEvents Issue Pin
bro_greg26-Jun-09 7:36
bro_greg26-Jun-09 7:36 
QuestionHow can I make this script/component accept server side rather than client side files Pin
smdevivo26-Jun-09 2:45
professionalsmdevivo26-Jun-09 2:45 
GeneralRe: How can I make this script/component accept server side rather than client side files Pin
Kschuler26-Jun-09 3:39
Kschuler26-Jun-09 3:39 
AnswerRe: How can I make this script/component accept server side rather than client side files Pin
Dave Kreskowiak26-Jun-09 4:57
mveDave Kreskowiak26-Jun-09 4:57 
QuestionVb 6.0 Pin
nazimghori26-Jun-09 1:50
nazimghori26-Jun-09 1:50 
AnswerRe: Vb 6.0 Pin
Enver Maroshi26-Jun-09 1:51
Enver Maroshi26-Jun-09 1:51 
GeneralRe: Vb 6.0 Pin
Christian Graus26-Jun-09 9:38
protectorChristian Graus26-Jun-09 9:38 
GeneralRe: Vb 6.0 Pin
Enver Maroshi26-Jun-09 21:03
Enver Maroshi26-Jun-09 21:03 
GeneralRe: Vb 6.0 Pin
Colin Angus Mackay26-Jun-09 22:07
Colin Angus Mackay26-Jun-09 22:07 
GeneralRe: Vb 6.0 Pin
Enver Maroshi26-Jun-09 23:32
Enver Maroshi26-Jun-09 23:32 
GeneralRe: Vb 6.0 Pin
Colin Angus Mackay27-Jun-09 2:14
Colin Angus Mackay27-Jun-09 2:14 
GeneralRe: Vb 6.0 Pin
Enver Maroshi27-Jun-09 3:07
Enver Maroshi27-Jun-09 3:07 
GeneralRe: Vb 6.0 Pin
Colin Angus Mackay27-Jun-09 3:14
Colin Angus Mackay27-Jun-09 3:14 
GeneralRe: Vb 6.0 Pin
Enver Maroshi27-Jun-09 3:40
Enver Maroshi27-Jun-09 3:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.