|
hi all,
It has dropdownlist in gridview.
I face a difficult in update the dropdownlist.selectedvalue into database.
May someone have simple example of source code to help me on this?
|
|
|
|
|
There are lots of ways to update database from gridview.
How you are doing it?
What difficulty you are facing?
|
|
|
|
|
in my gridview, i have linkbutton for add new row. below is the code for add new gridviewrow. but for the edit and update gridviewrow i still no has any idea. may u help me?
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs)
Dim conn As New SqlConnection("Data Source=localhost;Initial Catalog=Display;Integrated Security=True;")
Try
If e.CommandName.Equals("New") Then
Dim btnNew As LinkButton = TryCast(e.CommandSource, LinkButton)
Dim row As GridViewRow = TryCast(btnNew.NamingContainer, GridViewRow)
If row Is Nothing Then
Return
End If
Dim txtPickTownCity As TextBox = TryCast(row.FindControl("PickTownCityTextBox"), TextBox)
Dim dropdownlistPickState As DropDownList = TryCast(row.FindControl("DropDownList3"), DropDownList)
Dim txtDeliveryTownCity As TextBox = TryCast(row.FindControl("DeliveryTownCityTextBox"), TextBox)
Dim dropdownlistDeliveryState As DropDownList = TryCast(row.FindControl("DropDownList6"), DropDownList)
Dim cmd As New SqlCommand("INSERT INTO [Address] ([Pick_Town_City], [Pick_State], [Delivery_Town_City], [Delivery_State]) VALUES (@Pick_Town_City, @Pick_State, @Delivery_Town_City, @Delivery_State)", conn)
cmd.Parameters.AddWithValue("Pick_Town_City", txtPickTownCity.Text)
cmd.Parameters.AddWithValue("Pick_State", dropdownlistPickState.SelectedValue)
cmd.Parameters.AddWithValue("Delivery_Town_City", txtDeliveryTownCity.Text)
cmd.Parameters.AddWithValue("Delivery_State", dropdownlistDeliveryState.SelectedValue)
conn.Open()
If cmd.ExecuteNonQuery() = 1 Then
GridView1.DataBind()
End If
End If
Catch ex As Exception
Finally
conn.Close()
End Try
End Sub
|
|
|
|
|
|
hi,
i m a beginner in asp.net
i want to ask how to change pictures in adrotator without refreshing the page in a particular way(like screensavers work)
and i dont want to use ajax....
|
|
|
|
|
Try using html maybe with a marquee?
"Sex is not the answer, it's the question and the answer is yes"
|
|
|
|
|
i think the plan will be using ad rotator with datasource then put it into update panel(ajax) then add timer and use code behind to updatepanel.update() method evry fixed time based on the timer events
hope it help
drahmedgalal@hotmail.com
|
|
|
|
|
|
I have a requirement where i need to provide a Search facility to my web application.
Basically i will have a Search text box and a button. User can enter some words and when he clicks the button, the application should search some columns in a couple of tables and the details should be presented to the user. I don't know how to implement this.
Do any of u guys have an idea, i would be very thankful to u if u can share with me.
Thanks & Regards,
Krishna.
|
|
|
|
|
This is not a quite simple as I think.but may be this suggestion helps you
Follow these three steps
Store Procedure
First Step : Create temporary table
CREATE TABLE #TempTable
(
ID int IDENTITY PRIMARY KEY,
Column1 nvarchar(100),
Column2 nvarchar(100),
)
Second Setep: Insert matched records from other tables into temporary table
INSERT INTO #TempTable(column1,column2)
Select column1,column2 from myTable1 where column3=yourSearchingText
INSERT INTO #TempTable(column1,column2)
Select column1,column2 from myTable2 where column3=yourSearchingText
INSERT INTO #TempTable(column1,column2)
Select column1,column2 from myTable3 where column3=yourSearchingText
Third Step : Select all records from temp table
SELECT * FROM #TempTable
Best of luck
Regards
Khan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Or possibly just use a UNION predicate? Better asking this in the SQL forum...
|
|
|
|
|
|
Dear All
Is any one haveing have script wich converts english to french(in a text box)
Thanks
Siva
|
|
|
|
|
Oh god not again!
What makes you think Javascript alone would be capable of this task? Sure javascript could kick of an AJAX call to a server side translation engine... but thats not really javascript "converting english to french".
You dont seem to have much asp.net or web development experience? Try a beginners book on the subject and go from there. start smaller than a translation engine!
|
|
|
|
|
This is easy to write. You just need to send every English word and it's French translation to the client with every page. Your website will obvioulsy be huge and very slow, but you can do it, if you want to.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hi,
After Logging-in how to store the UserId and Password in session....
If the user clicks the Back or Previous button from the browser tool bar then how to kill the session......?
Please help me.....
Thanking you
Mcmilan.
|
|
|
|
|
mcmilan wrote: After Logging-in how to store the UserId and Password in session....
Why do you want to store password in session?
To store variable in session,
Session["MyKey"]=VariableName;
mcmilan wrote: If the user clicks the Back or Previous button from the browser tool bar then how to kill the session......?
You can't.
Onclick of browser Back or previous button,Just history of browser is change and content of page get back from cache memory.Page is not reloaded so you can not run code.
please don't forget to vote on the post that helped you.
|
|
|
|
|
If you put Session.Abandon(); in the page_load then that should do the trick. The only issue is that it will abandon the session everytime the user goes to that page.
Not a big deal if it's on the Login page though.
Hope this helps.
Cheers
Disgyza
Programmer Analyst
|
|
|
|
|
Session["UserId"]=txtuserid.text.trim();
To clear session
Session.Abandon();
|
|
|
|
|
I used the System.Diagnostics.Process.start method to open an application from an ASP.Net. It works fine when I debug it using VS 2005, but when I put it on a web server and click the button nothing happens. Please help me resolve this issue
|
|
|
|
|
Dot Net rookie wrote: but when I put it on a web server and click the button nothing happens. Please help me resolve this issue
Process runs on the server side so you can not see that process on client side.
please don't forget to vote on the post that helped you.
|
|
|
|
|
Thank you for responding. Is there another method I can use instead of process?
|
|
|
|
|
Dot Net rookie wrote: Is there another method I can use instead of process?
Which application you want to open?
What is your requirement?
please don't forget to vote on the post that helped you.
|
|
|
|
|
I want to open an application written in vb.net using VS2005.
|
|
|
|
|
Just using asp.net you will not be able to open (or generally interact at all) with a client computer. You'll need some kind of ActiveX or Applet control for this.
|
|
|
|