|
Yes...we can do.This is one way of passing data between web pages.
In the default.aspx page, you can get the value using,
string id = Request.QueryString["id"].ToString();
Regards,
Jay
|
|
|
|
|
hi,
i have an table in sql database.i want the write or export the records values into an excel sheet so how can i do that.someone please hepl me.im using asp.net1.1 and c#.
-- modified at 1:26 Wednesday 23rd August, 2006
-- modified at 1:56 Wednesday 23rd August, 2006
with regards,
susa
|
|
|
|
|
|
Here am getting problem with this code,how to comapare values,i am using Sql server
strselect = New SqlCommand("select Divi_name from Division", dbConn)
dtselect = strselect.ExecuteReader()
While (dtselect.Read())
If (nameBox.Text = dtselect("Divi_name")) Then
Lblmess.Text = "already existed"
End If
End While
Lblmess.Text = "Alraedy existed"
dtselect.Close()
|
|
|
|
|
Inspite of checking it in code behind you can check it in the backend itself. Or also you can send the query like where Divi_name="your input name" and in return if you are getting records then that exists in the database.
Best Regards,
Apurva Kaushal
|
|
|
|
|
strselect = New SqlCommand("select Divi_name from Division where Divi_name='"&nameBox.text&"'", dbConn)
dtselect = strselect.ExecuteScalar()
If dtselect = nameBox.Text Then
Lblmess.Text = "already existed"
End If
But this is also giving an error.
I am using sql server and i am new to this programming.
Give me a right solution if possible with dataset
|
|
|
|
|
here when you are fetching the record get it in the dataset and then check the record count if it is more that one then that name exists in the database.
Sample code to get the idea:
SqlConnection con = new SqlConnection();<br />
con.ConnectionString = ConfigurationSettings.AppSettings["DBConnStr"].ToString();<br />
con.Open();<br />
SqlCommand com = new SqlCommand("select * from RS_AUTHOR",con);<br />
SqlDataAdapter da = new SqlDataAdapter(com);<br />
DataSet ds = new DataSet();<br />
da.Fill(ds);<br />
Response.Write(ds.Tables[0].Rows.Count.ToString());
Here change the sql query with yours one.
Best Regards,
Apurva Kaushal
|
|
|
|
|
I have a excel file that contain some data I want to copy this data To Database (Access or SqlServer) ;
is there any Idea or sample code to do this ?
With Thanks
MHF
|
|
|
|
|
|
do you want import the data with sql server enterprisemanager?
|
|
|
|
|
Hi,
Any one suggest me, I am doing an event project, in this i am trying to store the event based on the date, when the user open's the calender to view the events based on the date, the dates in the calendar control should be Clickable only if that specified date contains any event in the database, else that date should not be an Clickable one.How to do this?? Can any one suggest me to do this??? I tried to change the IsSelectable = False, but all the dates become as simple text not as an link
Can any one suggest me how to do this???
Thanks in advance
Bye
Exelio
|
|
|
|
|
hi guys i was just wondering if anyone had any ideas or web site which teaches by step to step how to create a basic log in system on asp.net =)
your help is greatly appreciated.
|
|
|
|
|
Just do a search for "forms authentication" on this site and you'll have a slew of them, not to mention what google will spit out!
|
|
|
|
|
I have one textbox and one button when i click the button i want to set focus to the textbox.how can i do this?
E-Ramu
|
|
|
|
|
Hey.. Itz really a very simple one..
OnClick event of Button, use TextBoxID.Focus()
Regards,
Jay
|
|
|
|
|
Create a global function in a module named
Public Function SetFocus(ByVal FocusControl As Control) As String<br />
'Setting focus to supplied control<br />
Dim Script As New System.Text.StringBuilder<br />
Dim ClientID As String = FocusControl.ClientID<br />
<br />
'Building java script<br />
With Script<br />
.Append("<script language='javascript'>")<br />
.Append("document.getElementById('")<br />
.Append(ClientID)<br />
.Append("').focus();")<br />
.Append("</script>")<br />
End With<br />
<br />
Return Script.ToString()<br />
End Function
Now in button click event add:
RegisterStartupScript("setFocus", Utilities.SetFocus(YOUR TEXTBOX))
==postmaster
http://www.programmingknowledge.com/[^]
|
|
|
|
|
hi
i have an <asp:textbox> i want to validate it for character only,and generating alerts in java script,restrict user to enter only character how can i do this,and also want to validate dropdown and generate alerts select value
thanks
prabhakar dwivedi
|
|
|
|
|
You need to write a javascript function and need to call that onclick of the button. You can attach that javascript through attributes.add funtion of the button.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi, good day.
I have datagrid in my project page, i use the dataset to bind my datagrid from the database. The datagrid have an edit button to let user edit the data in it. My problem is i don't want update the edit data back to my database. I know a solution is to store the edit data in dataset.
But how to edit the data in the dataset and then update back to dataset? After edit/update the datagrid should be bind with the edited dataset, but how to write the code? I really no idea how to write it, can anyone help me to solve the problem? Thanks.... : )
Best Regards,
Pei Sun
|
|
|
|
|
You may refer the 'DataTable' in your DataSet. In that 'DataTable', you may edit the data whatever u want, by using 'DataRow'.
Note that you can refer each value in the DataRow using its Index. For example row["Title"].
Hope it ll help u.
Regards,
Jay
|
|
|
|
|
Hi, thanks for reply.
How to refer data table in dataset? After edit the data in data table, do we need to update it back to dataset?
Can you give me more guidelines? Thanks.
Best Regards,
Pei Sun
|
|
|
|
|
ds.Tables[x]
'x' may be the index or Name of DataTable.
u may first create a DataTable, and assign ur dataset values there like,
DataTable dt=ds.Tables[x]
Also u may keep that 'dt' in ur session, so that the edited values needs to be stored (bcoz u dont want to update in ur database).
-- modified at 1:26 Wednesday 23rd August, 2006
Regards,
Jay
|
|
|
|
|
How do u code switching from one webform to another?
thank you
Nothing lasts but nothing is lost
|
|
|
|
|
Response.Redirect("newForm.aspx");
|
|
|
|
|
thanks bro
Nothing lasts but nothing is lost
|
|
|
|