Jump to content


Check out our Community Blogs

MastaKay

Member Since 14 Nov 2007
Offline Last Active Nov 20 2007 03:25 AM
-----

Topics I've Started

marquee on aspx(ASP.NET)

20 November 2007 - 03:25 AM

Hi guys.



Im looking to have some moving text on my aspx page.

Any ideas. Just a single line with marquee that goes on forever till it reaches the end.



Thanx in advance.

Update database from ASPX datagrid

19 November 2007 - 11:42 PM

Hello guys.I have a problem updating my MS Access from datagrid.
The update button is ther already so I dont need it. I jus need the coding.
Here is what Ive got and I cant geddit correct.Thanx in advance guys.

Protected Sub GridView1_RowUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdatedEventArgs) Handles GridView1.RowUpdated
Dim cm As New OleDbCommand
Dim con As New OleDbConnection
Dim str1 As String = "Provider = Microsoft.Jet.oledb.4.0; Data source =C:\Documents and Settings\Kagisho.Mashiloane.ALFRGIS\My Documents\Visual Studio 2005\Projects\Search AL\TelephoneList.mdb"
Dim str2 As String
con = New OleDbConnection(str1)
con.Open()
str2 = "select * From Extensions"
cm = New OleDbCommand(str2, con)
Dim updateSQL As String = "UPDATE Extension SET Name = @Name, " & "Surname = @Surname, " & "Xtension = @Xtension"
cm.Parameters.Clear()
cm.Parameters.Add("@Name", Name)
cm.Parameters.Add("@Surname", Surname)
cm.Parameters.Add("@Xtension", Xtension)
cm.ExecuteNonQuery()
'Next
lblUpdatemessage.Text = "Update Successfull"

Updating MS Access from datagrid

19 November 2007 - 02:48 AM

Hi guys.Im looking to update my database from my datagrid.

My previous code is like this, so Im hoping sumone will assist me in doing so.
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged

        If IsNumeric(txtFirstName.Text) Then
            MsgBox("Please type your name in letters", MsgBoxStyle.Critical, "KNS System-Error")
            Exit Sub
        End If
        If IsNumeric(txtCity.Text) Then
            MsgBox("Please type your City in letters", MsgBoxStyle.Critical, "KNS System-Error")
            Exit Sub
        End If
        If Not IsNumeric(txtPostalCode.Text) Then
            MsgBox("Please type your PostalCode in numbers", MsgBoxStyle.Critical, "KNS-System-Error")
            Exit Sub
        End If
        If Not IsNumeric(txtCelnumber.Text) Then
            MsgBox("Please type your Cellphonenumber in numbers", MsgBoxStyle.Critical, "KNS-System-Error")
            Exit Sub
        End If
        da = New OleDbDataAdapter("Select * From Employees", cn)
        cb = New OleDbCommandBuilder(da)
        ds = New DataSet
        ds.Clear()
        da.Fill(ds, "Employees")
        dt = New DataTable
        dt = ds.Tables("Employees")
        Dim dr() As DataRow
        dr = dt.Select("EmpID = " & txtEmpID.Text & "")
        dr(0).BeginEdit()
        'dr(0)("Client_ID") = txtClientID.Text
        dr(0)("EFirstName") = txtFirstName.Text
        dr(0)("ESurname") = txtSurname.Text
        dr(0)("EDepartment") = cboDept.SelectedItem
        dr(0)("EPassword") = txtPassword.Text
        dr(0)("EConfirmPassword") = txtConfirm.Text
        dr(0)("EPhonenumber") = mtxtPhoneNumber.Text
        dr(0)("ECelnumber") = txtCelnumber.Text
        dr(0)("EAddress") = txtAddress.Text
        dr(0)("ECity") = txtCity.Text
        dr(0)("EPostalcode") = txtPostalCode.Text
        dr(0).EndEdit()
        da.Update(ds, "Employees")
        MsgBox("Record Edited Successfully")
        Disabling()
 End Sub

Problem is that this I did with text boxes.What Im looking for is updating directly from the datagrid.Thanx in advance

Birthday date problems

14 November 2007 - 12:18 AM

Hi guys.Im trying to get a birthday feature onto my aspx website by having on page load access to my MS Access database where there is a field called BirthDate(yyyy/mm/dd) which is a person's birthdate. If this date(the month and day) correspond with the current system day and month then the users' details have to be loaded onto a grid and displayed on the form.The problem is that I get a "no resources for one or more parameters"
Here is my code.

Imports System.Data
Imports System.Web.UI.Control
Imports System.Web.UI.WebControls.WebControl
Imports System.Web.UI.WebControls.LinkButton
Imports System.Data.oledb
Imports Microsoft.VisualBasic.ApplicationServices
Imports Microsoft.VisualBasic.OpenShare
Partial Class Birthdays
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim comx As New OleDbCommand
Dim conx As New OleDbConnection
Dim con As New OleDbConnection

Dim str1 As String = "Provider = Microsoft.Jet.oledb.4.0; Data source =C:\Documents and Settings\kagisho.mashiloane\My Documents\Visual Studio 2005\Projects\Search AL\TelephoneList.mdb"
Dim cm As OleDbCommand
Dim str2 As String

con = New OleDbConnection(str1)
con.Open()
str2 = " Select * from Bithdays WHERE (DATEPART(month, BirthDate)) ='" & Date.Today.Month & "' And (DATEPART(day, BirthDate)) = '" & Date.Today.Day & "'"
cm = New OleDbCommand(str2, con)

GridView1.DataSource = cm.ExecuteReader(CommandBehavior.CloseConnection)
GridView1.DataBind()
If con.State = ConnectionState.Open Then
con.Close()
End If

End Sub

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download