Jump to content
Xtreme .Net Talk

nkwk

Members
  • Posts

    13
  • Joined

  • Last visited

nkwk's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I wish Dreamweaver could interpret everything correctly. I do all my asp.net in vb but it is really poor for formatting pages (so ive found). It doesn't seem to support html tables very weel so I cant make everything expand and contract with a page resize :(.
  2. Never mind. Didn't realise asp databindings werent 2 way. nick
  3. I have to say, i'm toatally lost. Nothing seems to work. I cant update my SQL database. My code: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not Page.IsPostBack Then ConnectionOpen() Bind() End If End Sub Private Sub ConnectionOpen() Adapter1.SelectCommand.CommandText = "SELECT * FROM cases_enquiries WHERE ID = '" & Session("ID") & "'" Dataset1.Clear() Adapter1.Fill(Dataset1, "cases_enquiries") End Sub Private Sub ConnectionClose() Dataset1.Clear() End Sub Private Sub Bind() TextBox1.DataBind() TextBox2.DataBind() TextBox3.DataBind() TextBox4.DataBind() TextBox5.DataBind() TextBox6.DataBind() TextBox7.DataBind() TextBox8.DataBind() TextBox9.DataBind() TextBox10.DataBind() TextBox11.DataBind() TextBox12.DataBind() TextBox13.DataBind() TextBox14.DataBind() DropDownList1.DataBind() DropDownList2.DataBind() DropDownList3.DataBind() DropDownList4.DataBind() DropDownList4.DataBind() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Label16.Text = Adapter1.UpdateCommand.CommandText Adapter1.Update(DataSet1) DataSet1.AcceptChanges() End Sub If the value in textbox1 has changed from the original value of '1' to '2' What would I need to code for the dataset to update the SQL server? I've tried using the oledb adapter and the sqladapter and still no success. Nick
  4. Yeh sorry I removed that to make it less complicated. it reads: Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not Page.IsPostBack Then BindList() End If Label5.Text = SqlDataAdapter1.SelectCommand.CommandText End Sub
  5. I have problems with populating a datalist from my dataset. When I try it with a datagrid, everything seems to work fine but the datalist wont populate. I have a wizard created connection, adapter and dataset. The code: Private Sub BindList() SqlDataAdapter1.SelectCommand.CommandText = "SELECT * FROM mailinglist WHERE Firstname = 'nick'" SqlDataAdapter1.Fill(DataSet11, "mailinglist") DataList1.DataSource = DataSet11 DataList1.DataMember = "mailinglist" DataList1.DataBind() End Sub Then calling it from the page load: Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load BindList() Label5.Text = SqlDataAdapter1.SelectCommand.CommandText End Sub
  6. Sorry for keep coming back and forth but i don't have a clue lol. I'm figuring it out as i go along. How do i make the dataset goto the position that i have stored? Say I wanted it to goto record 10. Its not dataset11.tables(0).rows(10) (lost) Nick
  7. I'm going to try and use a session called "index" which will store on button_click and retrieve on page load.
  8. Man ... i'm seriously stuck. Could someone explain this to me. I keep seeing references to datagrid's everywhere. But i'm not use if thats what i want. I'm just trying to create a basic webform that will navigate records on the sql server. So textbox1 would read record one on load. Then when you hit next Textbox1 displays record 2. I cant find example coding anywhere for the next button :( nick
  9. I've written a couple of windows based database apps now which would usually use this code to navigate to the next record: Me.BindingContext(DataSet1, "mailinglist").Position = (Me.BindingContext(DataSet1, "Mailinglist").Position + 1) But in asp.net this isnt possible. My feeble code currently exists of: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load SqlDataAdapter1.Fill(DataSet11) TextBox1.DataBind() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click End Sub This has bound a textbox to the dataset. How would i navigate to the next record in the dataset? Nick
  10. nkwk

    Capture F5

    Hello mate, For some reason that only works on a blank form. The moment i start putting objects on it, it doesnt work anymore. Almost like the form isnt on top anymore. Any ideas? Regards, Nick
  11. nkwk

    Capture F5

    Help .... im stuck In vb6 I would have done Select Case KeyCode Case vbKeyF5 msgbox "123" End Select But I dont know how to do it in .net Regards Nick
  12. Oh Dear I'm a bit lost now. Basically the problem is that I can create a new record etc in the dataset but then when you hit save it isnt updating the sql server. So if you exit and re-open the application the changes are gone because the dataset has been wiped. Ive just discovered that I haven't specified the Update Command Text which is obviously the source of the problem. Newbie Time, I dont know how to write an update command string My select string: SELECT ID, [Telephone ], [MCCB number ], , Surname, Firstname, [Company Name], [Ad line 1], [Ad line 2], [Ad line 3], [Ad line 4], Postcode, [introduced by], [Date Added], [Come from] FROM mailinglist if i wanted to say update ID from textbox1 (which is bound to the ID field) how do i specify that? UPDATE mailinglist SET ID=? Kind Regards, Nick
  13. If i connect to an sql server using Connection1 Adapter1 Dataset1 I want to save a new record that I have added. so --Fill on form load-- adapter1.fill(dataset,"testdb") --Click the AddNew Button-- Me.BindingContext(DataSet1, "testdb").CancelCurrentEdit() Me.BindingContext(DataSet1, "testdb").AddNew() *fill in my fields on the form (which are bound to the dataset)* I now want to update the sql server so I thought it would be a simple --Update-- adapter1.update(dataset1,"testdb") But that doesnt work. :( Please can someone help me with my dataset? Nick
×
×
  • Create New...