Hi all,
I am new to asp.net programming, I have created an sql table for Employees and now i am able to save the values from my web page to the database but i am not able to retrieve the same values for editing purpose can any one help me please its very urgent,
any help or suggestions are greatly appreciated
Thanks in advance,
Raghu.
How to retrieve values from sql database
Page 1 of 14 Replies - 5003 Views - Last Post: 13 January 2009 - 04:12 AM
Replies To: How to retrieve values from sql database
#2
Re: How to retrieve values from sql database
Posted 31 December 2008 - 06:57 AM
Show us what you've tried so far
[rules][/rules]
[rules][/rules]
#3
Re: How to retrieve values from sql database
Posted 31 December 2008 - 07:06 AM
PsychoCoder, on 31 Dec, 2008 - 05:57 AM, said:
Show us what you've tried so far
[rules][/rules]
[rules][/rules]
Well i dont know any thing about data retrieving so to show you i dont have anything except the part for saving the values into the database
My code goes here:
Protected Sub btnsave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsave.Click
'myConnection = New Data.SqlClient.SqlConnection("Data Source=CONFAI17\SQLEXPRESS;Initial Catalog=HRDATA;Integrated Security=True")
myConnection = New Data.SqlClient.SqlConnection("Data Source=server1;Initial Catalog=master;Persist Security Info=True;User ID=sa;Password=pass#word1")
Dim InsertCmd = "Insert into Employeedata(ID,EName,Department,Designation,ContactNumber,EmergencyContact,OfficeNumber,Email,PersonalEmail,Dob,Doj,Address,BloodGroup,BankName,Branch,AccountNumber,Details_of_Id_Card,Salary) values('" & txtid.Text.ToString() & "','" & txtname.Text.ToString() & "','" & ddldept.SelectedItem.ToString() & "','" & txtdesig.Text.ToString() & "','" & txtcnum.Text.ToString() & "','" & txtemernum.Text.ToString() & "','" & txtoffnum.Text.ToString() & "','" & txtemail.Text.ToString() & "','" & txtpersonalid.Text.ToString() & "','" & d.Date.ToString() & "','" & s.Date.ToString() & "','" & txtadd.Text.ToString() & "','" & ddlbgrp.SelectedItem.ToString() & "','" & txtbname.Text.ToString() & "','" & txtbranch.Text.ToString() & "','" & txtaccnum.Text.ToString() & "','" & ddldoic.SelectedItem.ToString() & "','" & txtsal.Text.ToString() & "')"
myCommand = New Data.SqlClient.SqlCommand(InsertCmd, myConnection)
myConnection.Open()
myCommand.ExecuteNonQuery()
myCommand.Connection.Close()
End Sub
Please guide me through any tutorial or any suggestion on how to retrieve values from the database for editing and later when the editing is finished then the user should save the data back to the database.
Thanks for your reply,
Raghu.
#4
Re: How to retrieve values from sql database
Posted 31 December 2008 - 07:07 AM
#5
Re: How to retrieve values from sql database
Posted 13 January 2009 - 04:12 AM
eclipsed4utoo, on 31 Dec, 2008 - 06:07 AM, said:
Hi,
i did all that stuff of creating database and all but I have to change the values of a web page according to the drop down list values selection. Like if the user selects a value from the drop down list the values for the respective fields automatically.
How can we do that?
Raghu.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|