Jump to content
Sign in to follow this  
daq_kecic

Sistem By Vb N Db

Recommended Posts

monink... cmner ek nk paparkan data lam DB ke VB, kire pas kte key in data n nk displaykn data in VB, da coding dye x.. sye wt sistem sal sewaan tapak permainan... hope u can help me... blush.gif

Share this post


Link to post
Share on other sites
[quote name='daq_kecic' date='15 November 2008 - 10:33 AM' timestamp='1226716401' post='851477']
monink... cmner ek nk paparkan data lam DB ke VB, kire pas kte key in data n nk displaykn data in VB, da coding dye x.. sye wt sistem sal sewaan tapak permainan... hope u can help me... <img src="http://forum.putera.com/tanya/public/style_emoticons/<#EMO_DIR#>/blush.gif" style="vertical-align:middle" emoid=":blush:" border="0" alt="blush.gif" />
[/quote]


aku pun nak tau gakkk mcm mana nk paparkan data lam DB ke VB .. share lah ngan aku

Share this post


Link to post
Share on other sites
ak amik data dr access n appear kn dkat vb gne web application.

ni source:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">


<asp:DataGrid id="DataGrid1" runat="server" BorderStyle="None" AutoGenerateColumns="False" Width="950px" BackColor="White" BorderColor="#3366CC" BorderWidth="1px" CellPadding="4" HorizontalAlign="Center" EnableTheming="True" DataSourceID="ObjectDataSource1" Height="100px" Font-Names="Arial" Font-Size="Small">
<HeaderStyle ForeColor="White" Font-Bold="True" Font-Italic="False" Font-Overline="False" Font-Size="Small" Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" />
<Columns>
<asp:BoundColumn DataField="StockCode" ReadOnly="True" HeaderText="Stock Code">
<HeaderStyle BackColor="#003399" Font-Names="Arial" />
<ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" HorizontalAlign="Center" />
</asp:BoundColumn>
<asp:BoundColumn DataField="ReturnOnTotalAssets" ReadOnly="True" HeaderText="Return On Total Assets" DataFormatString=" {0:N2}">
<HeaderStyle BackColor="#003399" Font-Names="Arial" />
<ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" HorizontalAlign="Right" />
</asp:BoundColumn>
<asp:BoundColumn DataField="ReturnOnEquity" ReadOnly="True" HeaderText="Return On Equity" DataFormatString=" {0:N2}">
<HeaderStyle BackColor="#003399" Font-Names="Arial" />
<ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" HorizontalAlign="Right" />
</asp:BoundColumn>
<asp:BoundColumn DataField="CurrentRatio" ReadOnly="True" HeaderText="Current Ratio" DataFormatString=" {0:N2}">
<HeaderStyle BackColor="#003399" Font-Names="Arial" />
<ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" HorizontalAlign="Right" />
</asp:BoundColumn>
<asp:BoundColumn DataField="TotalLiabilitiesToEquityRatio" ReadOnly="True" HeaderText="Total Liability to Equity Ratio" DataFormatString=" {0:N2}">
<HeaderStyle BackColor="#003399" Font-Names="Arial" />
<ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" HorizontalAlign="Right" />
</asp:BoundColumn>


</Columns>
</asp:DataGrid>

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName="DataSet1+YEARLY_DATADataTable" InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="DataSet1TableAdapters.YEARLY_DATATableAdapter" UpdateMethod="Update">
<InsertParameters>
<asp:Parameter Name="StockCode" Type="String" />
<asp:Parameter Name="ReturnOnTotalAssets" Type="String" />
<asp:Parameter Name="ReturnOnEquity" Type="String" />
<asp:Parameter Name="CurrentRatio" Type="String" />
<asp:Parameter Name="TotalLiabilitiesToEquityRatio" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>







</form>
</body>
</html>


ni vb nye code:


Imports System.Data
Imports System.Data.OleDb


Partial Class _Default
Inherits System.Web.UI.Page
Private con As OleDbConnection
Dim activity As String
Dim logintime As String
Dim logindate As String

Dim url As String
Dim IP As String
Dim logID As String
Dim department As String


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("SurveillanceMIS.mdb"))
logID = Session("LoginID")
department = Session("Department")

BindGrid()



DataGrid1.Visible = True

End Sub


Sub BindGrid()
' Fill our dataset
'SqlDataAdapter1.Fill(DataSet1)
' Assign the dataset to our Datagrid called dgToExport
'GridView1.DataSource = DataSet1
' Finally bind the datagrid
DataGrid1.DataBind()
End Sub

End Class

arap mmbantu!!!


*ak nk cari code utk color kn specific box dlm databse 2...after dh apear kt web (ad condition) then die leh colourkn box kalu TRUE utk condition2 yg sesuai...arap blei tlg,thx

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...