Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi..Welcome to Daniweb friend :)
Post your problem on Tech Talk

Jx_Man 987 Nearly a Senior Poster Featured Poster

this following code to display data on datagrid.

Dim con As New OleDb.OleDbConnection
    Dim cmdOle As New OleDb.OleDbCommand
    Dim dsOle As New DataSet
    Dim da As New OleDb.OleDbDataAdapter
    Dim dtOle As New DataTable
    Dim sql As String

Private Sub LoadData()
        con.ConnectionString = ("Provider = Microsoft.JET.OLEDB.4.0;Data Source= D:\Only Me\Authors.mdb")
        Try
            cmdOle = con.CreateCommand
            cmdOle.CommandText = "SELECT * FROM Authors "
            da.SelectCommand = cmdOle
            da.Fill(dsOle, "Authors")
            dgAuthor.DataSource = dsOle
            dgAuthor.DataMember = "Authors"
            dgAuthor.ReadOnly = True
        Catch ex As Exception
            MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly, "Koneksi Error !!")
        End Try
    End Sub

    Private Sub Search_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        LoadData
    End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

you're welcome...
don't forget to mark this thread solved.
Happy coding friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

First off, you don't need to use the statement With Me because it's redundant.

agree with Oxiegen...

Jx_Man 987 Nearly a Senior Poster Featured Poster

i post an attachment for example of search engine

Jx_Man 987 Nearly a Senior Poster Featured Poster

Private Sub CalculateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalculateButton.Click
'Calculate and display the amounts and add to totals
With Me

If makeoverRadioButton.Checked Then
.MakeoverLabel.Text = MAKEOVER_Decimal.ToString()
If HairStylingRadioButton.Checked Then
.hairStylingLabel.Text = HAIR_STYLING_Decimal.ToString()
If manicureRadioButton.Checked Then
.manicureLabel.Text = MANICURE_Decimal.ToString()
If permanentMakeupRadioButton.Text = PERMANENT_MAKEUP_Decimal.ToString() Then
End If
End If
End If
End If
End With
End Sub

why it can be :
1. you didn't used else so your if statement become a nested if.
2. you don't assign radio button as true when you checked them in if statement.
3. your last if statement is wrong (permanentMakeupRadioButton.Text = PERMANENT_MAKEUP_Decimal.ToString)
this following code is a right :

With Me
      If makeoverRadioButton.Checked = True Then
            .MakeoverLabel.Text = MAKEOVER_Decimal.ToString()
          Else
             If HairStylingRadioButton.Checked = True Then
                 .hairStylingLabel.Text = HAIR_STYLING_Decimal.ToString()
             Else
                 If manicureRadioButton.Checked = True Then
                    .manicureLabel.Text = MANICURE_Decimal.ToString()
                 Else
                     If permanentMakeupRadioButton.Checked = True Then
                         .permanentMakeupLabel.Text = PERMANENT_MAKEUP_Decimal.ToString()
                     End If
                 End If
              End If
          End If
 End With

try it and give a feedback

Jx_Man 987 Nearly a Senior Poster Featured Poster

on other form :

textbox1.text = frm_playername.txtPlayerName.text
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi..Welcome to Daniweb :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi..Welcome to Daniweb :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi..Welcome to Daniweb :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Nadhi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

use Package & Deployment Wizard.
Microsoft Visual Studio 6.0 ->Microsoft Visual Studio 6.0 Tools -> Package & Deployment Wizard.

Jx_Man 987 Nearly a Senior Poster Featured Poster

what exactly do you want?

Jx_Man 987 Nearly a Senior Poster Featured Poster

yes, it possible to change directly. but i never tried it before.
you can use searching tool in this forum and search for similiar thread, there are many thread to change directly to the dg view.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Rupam...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Sean, Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi..Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)
>>this is a cool an active site.
Yes you're absolutely right.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Never tried = Never Know is very good word Thanks again

thats my signature...its not a part of post.
it always shown every time i post

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

please post in current section (java script). this for vb.net

Jx_Man 987 Nearly a Senior Poster Featured Poster

you just make database which table is Id, FirstName, LastName and age like what i description in that snippet and you just copied that code.
there are none configuration or something using adapter control.

'a database with 4 column (Id[primary key],FirstName,LastName,Age)
'3 button (cmdSave,cmdEdit,cmdDelete)
'4 text box (txtId,txtFirstName,txtLastName,txtAge).
'1 datagrid (named dgStudent)
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

what control of collection?listbox or combo box, listview??

Jx_Man 987 Nearly a Senior Poster Featured Poster

i am writing in c#

Post in c# or asp.net. this for vb.net

Jx_Man 987 Nearly a Senior Poster Featured Poster

this code for MS Sql.
i never tried it for postgres, just for access.

Jx_Man 987 Nearly a Senior Poster Featured Poster

see this snippet, i write this code in vb.net 2003 and sql2000 but you can use it in vb.net 2005 and sql 2005. same code.
1. Show Data in DataGrid with VB.Net 2003 and SQLServer 2000
2. Save, Edit, Delete Data using VB.Net and SQL Server 2000

Jx_Man 987 Nearly a Senior Poster Featured Poster

yeah, i convert it in that tools...

Jx_Man 987 Nearly a Senior Poster Featured Poster

outputTextBox.Text ="\t\t .........." + Environment.NewLine;

Great...
i don't have much experience in c#, thx for information narue.

Jx_Man 987 Nearly a Senior Poster Featured Poster

use this code to load data on dropdownlist

Private Sub ReadData()
        Dim i, k As Integer
        Dim cmdCountry As New SqlCommand
        Dim daCountry As New SqlDataAdapter
        Dim dsCountry As New DataSet
        Dim dtCountry As New DataTable
        Dim conn As SqlConnection

        conn = GetConnect()
        Try

            cmdCountry = conn.CreateCommand
            cmdCountry.CommandText = "SELECT * FROM TableName"
            daCountry.SelectCommand = cmdCountry
            daCountry.Fill(dsCountry, "TableName")
            dtCountry = dsCountry.Tables("TableName")
            For i = 0 To dtCountry.Rows.Count - 1
                CmbCountry.Items.Add(dtCountry.Rows(i).Item(0)) ' which item on table that u want to display in dropdwn list
            Next

        Catch ex As Exception
            MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly, "Connection Error !!")
        End Try
        conn.Close()
    End Sub

to set default value :
CmbCountry.Text = "Select Country"

Jx_Man 987 Nearly a Senior Poster Featured Poster

thx but i just can do much vb...
Actually a really interested with C#.
hmm..your avatar, what it is??

Jx_Man 987 Nearly a Senior Poster Featured Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster

if this thread solved, please mark as Solved.
Happy coding Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

what the problem?
getting data from database or set default value in dropdown list?

Jx_Man 987 Nearly a Senior Poster Featured Poster
Dim bmData As BitmapData = glyph.LockBits(New Rectangle(0, 0, glyph.Width, glyph.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb)
Dim scan0 As IntPtr = bmData.Scan0
Dim nOffset As Integer = bmData.Stride - glyph.Width * 3

Dim pDest As Byte* = CByte(CType(scan0, void*))
For y As Integer = 0 To glyph.Height - 1
    
    For x As Integer = 0 To glyph.Width - 1
        ' Check whether transparent:
        If transColor.R = pDest(2) AndAlso transColor.G = pDest(1) AndAlso transColor.B = pDest(0) Then
            ' set to background colour
            pDest(2) = backColor.R
            pDest(1) = backColor.G
            pDest(0) = backColor.B
        Else
            ' Get HLS of existing colour:
            Dim pixel As Color = Color.FromArgb(pDest(2), pDest(1), pDest(0))
            Dim lumPixel As Single = pixel.GetBrightness()
            If lumPixel <= 0.9F Then
                Dim lumOffset As Single = lumPixel / transLuminance
                lumPixel = backLuminance * lumOffset
                If lumPixel > 1F Then
                    lumPixel = 1F
                    
                End If
            End If
            ' Calculate the new colour
            Dim newPixel As New HLSRGB(backHue, lumPixel, backSaturation)
            
            ' set the values:
            pDest(0) = newPixel.Blue
            pDest(1) = newPixel.Green
            pDest(2) = newPixel.Red
        End If
        ' Move to next BGRA
        pDest += 3
    Next
    pDest += nOffset
Next

glyph.UnlockBits(bmData)
majestic0110 commented: Brilliant helper! +2
Vega_Knight commented: Great... +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

calculator, binding data,

Jx_Man 987 Nearly a Senior Poster Featured Poster

- Started with Pascal in 2003 for 6 months
- Visual Basic from 2004 until now..
- C and Matlab for 6 months,
- C++ for 6 Months,
- Java for 6 months,
- VB.Net And ASP.Net in last 2 years until now...
- And this year i learning for C#.net, Delphi, PHP and Ruby.
Do all with Access, SqlServer, MySql and Oracle.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

HI Nuno...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

what kind of application??
post your code, will helps..

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Sir,

I'm using drop down list to get country names from Database(SQL SERVER)..Now th epblm is i'v to hv the "Select Country" as the default one for Drop Down list.Help me in this.Thank you

do not hijack other thread, please make your own thread...

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

this thread already solved?
if yes, please share your answer friend...
so other members can learning form you :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

post your code...

Jx_Man 987 Nearly a Senior Poster Featured Poster

outputTextBox.Text ="\t\t ..........\n";

Should be :

outputTextBox.Text ="\t\t ..........[B]\r\n[/B]";
Naruse commented: Great +1