Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
P

Pete Newman

@Pete Newman
About
Posts
26
Topics
14
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Need help undestandinf the concept
    P Pete Newman

    Hi Paddy Thanks for the reply, Thats a way forward for me, tho i must admit i havent made it fully clear on what im trying to do. I onlu used one text box as an example, there will be about 20 in total with some 300 records in the table, which i need to navigate through, hence i was trying to bind to the text box to the table Thanks again, i can now see a way forwards :-D

    I really do need help..... all this computer stuff is way over my head !!

    ASP.NET csharp css asp-net database

  • Need help undestandinf the concept
    P Pete Newman

    Running Vista ( business ) , SQl 2005 and VS 2005 (VB.net) I apoliguise if this is posted in the wrong forum Ok im trying to create an asp.net page that has a 'text' box on it ( no data grid ). in the vb code ( i believe its called code behind ) i have connected to a data source and created a data table - dt .. ( code below ). Ive been looking at lots of different articles and all i manage is to go in circles. Is it possible to write all the 'code behind' and just bind the data to a text box and if so using the code below how can i bind the field Licence to the text box StrLicence Alternatly would it be more productive to look at just the asp code, and if so how can i do the same with out using the Form View Any help would be most appriciated Vb code Dim Conn As SqlConnection = New SqlConnection(connectionString) Try Conn.Open() Response.Write("SQL Connection = " & Conn.State.ToString) Dim Adapter As SqlDataAdapter = New SqlDataAdapter(SelectCommand, Conn) Try Adapter.Fill(dt) Response.Write("Filled Data Table") Catch ex1 As Exception Response.Write(ex1.Message) End Try Catch ex As Exception Response.Write(ex.Message) End Try dt = Nothing Conn.Close() Conn = Nothing

    I really do need help..... all this computer stuff is way over my head !!

    ASP.NET csharp css asp-net database

  • Opening Forms
    P Pete Newman

    we have an inhouse menu type application, when a operator logs onto the stytem , ihave a function that dynamicly creates the menu oprtions for this operator from there profile. ie in design tine the form is blank, but buttons ( options buttons ) , and click even handlers are generated for all the area's they are allowed to access. this info is held in a SQL2005 table ie .. Operator 1 can access area's 1,2,3, and 4 so would have 4 buttons on screen , Operator 2 can only access area's 1 and 4 hance only has two buttons. As the buttons are dynamicly generated the indexes ( start at 0 ) are never the same. in the example above operator button index 1 would be for Area 2 where as for operator 2 it would be for area 4 i have a work round by Dimming every form and then using the button text in a case statement to determine which button was clicked, but that means every time i add a new form i have to remember to add it in the select case statement ... If i can use the form name form the SQL table in a simple routine it will save endless pages of coding and i wont have tp remember to keep comming back to the master form and adding the reference in its the simple idea's that prove to be the hardest !!

    I really do need help..... all this computer stuff is way over my head !!

    Visual Basic csharp visual-studio help

  • Opening Forms
    P Pete Newman

    I do know thre is a way of doing this, as i have seen the code, just carnt remember it. The reason i want to do it this way is that there are a number of users that will be using this application, each one on them will have a 'main selection screen' which will have upwards of 20+ options. each option will open a new form. NOT all the operators will have the same options so rather than have a while load of code declaring every form, i just want a small simple routine.

    I really do need help..... all this computer stuff is way over my head !!

    Visual Basic csharp visual-studio help

  • Opening Forms
    P Pete Newman

    VS 2005 (VB.Net) Is it possible to open a form by a string name without having to declare the form first , ie normally you would Dim SomeForm as New FormName SomeForm.Show What i wasnt yo do is create a dynamic form, and when the user clicks a button it open a corraspoinding form. As each user will have different 'buttons' on there forms i want to have a routine that i can parm a formname in as a string and it open the form. ie Dim FormName as String = 'SomeFormName' FormName.Show Any idea's :^)

    I really do need help..... all this computer stuff is way over my head !!

    Visual Basic csharp visual-studio help

  • AddHandler Question
    P Pete Newman

    vs.net ( vb ) 2005 I have a form which when loaded adds x number of checkboxes. In the function i have written to add the checkboxes i have included the folling lines ACheckBox.Tag = Index ' Index being the number of the current Checkbox AddHandler aCheckBox.CheckChanged, AddressOf MyClickHandler How in the 'MyClickHandler' sub will i be able to find the index of the aCheckBox that was clicked ? Thanks for any help :doh:

    I really do need help..... all this computer stuff is way over my head !!

    Visual Basic question csharp database visual-studio help

  • Help on Datasets
    P Pete Newman

    running vb.net 2005 & sql 2005 Ive been trying to add what seemed a simple table to a form ... only three four fields plus an update and cancel button I managed to ( from samples ) add an OleDbConnection connecton, a OleDbDataAdapter complete with select and update commands and a dataset . From previous samples ( win 2003 dataform ) i have the four text boxex reporting back the data from the dataset ... Stage 1 complete. now here is where i was comming a cropper, when trying to update the table i used the following commands Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click Try 'Attempt to update the datasource. Me.UpdateDataSet() MsgBox(" Update sucessful") Catch eUpdate As System.Exception 'Add your error handling code here. 'Display error message, if any. System.Windows.Forms.MessageBox.Show(eUpdate.Message) End Try End Sub Public Sub UpdateDataSet() 'Create a new dataset to hold the changes that have been made to the main dataset. Dim objDataSetChanges As Boss.net.DebBacsFmDestAccs = New Boss.net.DebBacsFmDestAccs 'Stop any current edits. Me.BindingContext(DebBacsFMDestAccounts1, "DebBacsFmDestAccs").EndCurrentEdit() 'Get the changes that have been made to the main dataset. objDataSetChanges = CType(DebBacsFMDestAccounts1.GetChanges, Boss.net.DebBacsFmDestAccs) 'Check to see if any changes have been made. If (Not (objDataSetChanges) Is Nothing) Then Try 'There are changes that need to be made, so attempt to update the datasource by 'calling the update method and passing the dataset and any parameters. Me.UpdateDataSource(objDataSetChanges) DebBacsFMDestAccounts1.Merge(objDataSetChanges) DebBacsFMDestAccounts1.AcceptChanges() Catch eUpdate As System.Exception 'Add your error handling code here. Throw eUpdate End Try 'Add your code to check the returned dataset for any errors that may have been 'pushed into the row object's error. End If End Sub Public Sub UpdateDataSource(ByVal ChangedRows As Boss.net.DebBacsFmDestAccs) Try 'The data source only needs to be updated if there are changes pending. If (Not (Ch

    Visual Basic help csharp database announcement

  • Closing a form from a class
    P Pete Newman

    running VS ( Vb.Net ) 2005 with a lot of help from various people ive managed to cobble together a very nifty vbclass. Basicly the app im writing, logs a user into a SQl server. There is a table which controls what areas of the software the user can access, once logged in they are redirected to a blank form ( mainOptions ). MainOptions call a class which adds a button to the form for every area thay are allowed in. I can using a clickhandler in the class redirect the user to the desired area ( form ) hovever i carnt close or hide the mainOptions form ...... as the class is controlling the ClickHandler and the redirect, im tried ther following select case sender case Area1 Dim nform as new Area1_Form ** mainOptions.hide ** Area1_form . showdialog end select ive also tried mainOptions.close ive even tried calling a function back on the mainOptions form to close but it wont close down any idea's :sigh:

    I really do need help..... all this computer stuff is way over my head !!

    Visual Basic csharp database sql-server visual-studio

  • Transparant background
    P Pete Newman

    If i have a label on a form, how can i code it so the background colour is transparrant @ runtime ?

    I really do need help..... all this computer stuff is way over my head !!

    Visual Basic question help

  • Questions on Forms
    P Pete Newman

    VB.net 2005 & SQL 2005 Hi all, this is a three part question, as im to lazy to put up three different posts. The project is an application that contains several forms, all accesses from a main form Q1. Once the user is logged on they arrive at the 'main menu'. what id like to try and do is dynamicaly create the options on that form dependant on what they are allowed to do ( this can be obtained via SQL query ) there is a table in the database that holds all the form names, display names and security level What id like to do is display only those 'display names' that the user have the releven security level to, and have the onclick event . to redirect them when the select a form I know there are some real wizz guys out there, but inststead of just throwing code, can some one give an example and explian what its doing so i can at least learn from this Q2. In the old vb6 there was a 'status' panel that i used to stick in info like current user , time etc. the questio is is there a similar control or would it be more prudant to create a custom control and if so how?. Is there a sim[ple way of having this on every form without having to code it every time.... Q3. Form Settings. Currently i have a function that i call from every form that paints the form a certain colour, is there a better way to do this rather than calling a function on each forms 'load' event. once again thanks for all you help ... this site is a great learning tool.. keep up the good work!!

    I really do need help..... all this computer stuff is way over my head !! :confused:

    Visual Basic database question csharp security

  • Label Fonts
    P Pete Newman

    :-D glad some one knows how this stuff works :rolleyes: cheers

    I really do need help..... all this computer stuff is way over my head !!

    Visual Basic help question

  • Label Fonts
    P Pete Newman

    is there a way to set the label font to bold at runtime ?:^)

    I really do need help..... all this computer stuff is way over my head !!

    Visual Basic help question

  • Is this possible
    P Pete Newman

    Running vs2005 ( vb.net ) im trying to write an intranet app and one of the problems im comming up against is displaying data retrieved from a SQl Select query and displaying one record in text boxes much the same style as the old VB6. I welcome any suggestion and examples please. current pageload code Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim sqlConn As New SqlClient.SqlConnection Dim sqlCommand As New SqlClient.SqlCommand Dim SqlReader As SqlClient.SqlDataReader Try sqlConn = New SqlClient.SqlConnection(System.Configuration.ConfigurationManager.AppSettings("SQLConnectStr")) sqlCommand = New SqlClient.SqlCommand("Select * from Bossdata.dbo.clientadmin") SqlReader = sqlCommand.ExecuteReader Catch ex As Exception ' Code for error trapping goes here End Try End Sub thanks in advance

    I really do need help..... all this computer stuff is way over my head !!

    Visual Basic database help csharp workspace

  • Global.aspx
    P Pete Newman

    hi, ive been trying to edit the global.aspx file to create an application connection to the SQL Server. Code <%@ Application Language="VB" %> <%@ Import Namespace="System.Data.SQLCLIENT" %> <%@ Import Namespace="System.Data" %> Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) ' Code that runs on application startup Dim sqlConn As New SqlClient.SqlConnection Dim sqlCommand As New SqlClient.SqlCommand Dim ConectStr As String = "Data Source=DEVELOPMENT\SQLEXPRESS;Initial Catalog=Testdata;Integrated Security=True" sqlConn = New SqlClient.SqlConnection("ConectStr") sqlConn.Open() Application("SQLConnection") = sqlConn End Sub Any ideas where im going wrong as this keeps failing. Thanks in advance I really do need help..... all this computer stuff is way over my head !!</x-turndown>

    Visual Basic database sql-server sysadmin security help

  • Stored Procs
    P Pete Newman

    cheers AreJay i know there has to be a way... but well its beyond me :doh:

    I really do need help..... all this computer stuff is way over my head !!

    Visual Basic database design security help

  • VB 2005
    P Pete Newman

    I have a vb2005 logon.aspx page and i have on that page i have the standered System.web.UI.WeControls.login. what im trying to find out is how to dynamicly poition the control in the centre of the page

    I really do need help..... all this computer stuff is way over my head !!

    Visual Basic design help tutorial

  • Stored Procs
    P Pete Newman

    AreJay, seems like ive hit a small problem, what happens if the stored proc returns a integer , ie in the stored procedure its returning an int as an output parameter; in the stopred proc @ReturnValue INT OUTPUT

    I really do need help..... all this computer stuff is way over my head !!

    Visual Basic database design security help

  • Stored Procs
    P Pete Newman

    That will work a treat, Its very similar to what i use in a standered VB6 application, :doh: just didnt think it would work on this for some reason. Thats the great thing about this site, theres always something more to learn :cool: Thanks again

    I really do need help..... all this computer stuff is way over my head !!

    Visual Basic database design security help

  • Stored Procs
    P Pete Newman

    Thanks to the help from yesterday i have managed to get thus far, just one stumbling block left if any one can help Code from login Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate Dim mydataSet As New DataSet Using connection As New SqlConnection("Data Source=TESTSQL;Initial Catalog=DevDataBase;Integrated Security=True") Dim adapter As New SqlDataAdapter() adapter.SelectCommand = New SqlCommand("Select Count(*) from DevDataBase.dbo.Operators where Name = '" & logon1.UserName & "' and Psw = '" & logon1.Password & "'", connection) adapter.Fill(mydataSet) MsgBox(mydataSet.Tables(0).Rows(0)(0)) End Using End Sub If the user name and password are correct then I get a count of 1. How would this work with a stored procedure Stored Procedure Name is 'OpersLogon' and the parameters supplied are @OperatorName varchar(20), @OperatorPassword varchar(20), @ReturnValue Int Output

    I really do need help..... all this computer stuff is way over my head !!

    Visual Basic database design security help

  • One last hope
    P Pete Newman

    nlarson11 I got an email from the site, but no message on the forum :^) . From the email tho yes i know the connection string is correct. If its easier you can mail me direct ?

    I really do need help..... all this computer stuff is way over my head !!

    Visual Basic help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups