|
have you tried skype? or google talk (I think they now have video too)?
|
|
|
|
|
|
Have a look at the below link
Link1[^]
Link2-[Video chat & Voice Chat][^] to read discussion having same question with perfect solutions
Link3[^] to download Videos Tutorial.
and Finally don't forget you have to create ActiveX control that visitors must have to installed its just because of Because a webcam is a clientside device you cannot control it from a serverside-codebehind.
|
|
|
|
|
Hello;
In the master page of my site I have a textbox that displays the school year, to recover the value of textbox in other pages I used:
page.master.cs
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
Label13.Text = Convert.ToString(DateTime.Now);<br />
SqlConnection myConnection = new SqlConnection(ConnectionString);<br />
myConnection.Open();<br />
<br />
<br />
String maRequete = "select ann_uni as [p1]from annee where @param between date_debut and date_fin";<br />
SqlCommand myCommand = new SqlCommand(maRequete, myConnection);<br />
myCommand.Parameters.Add(new SqlParameter("@param", SqlDbType.DateTime));<br />
myCommand.Parameters["@param"].Value = Label13.Text;<br />
SqlDataReader drr2 = myCommand.ExecuteReader();<br />
<br />
<br />
while (drr2.Read())<br />
{<br />
Textbox1.Text = drr2["p1"].ToString();<br />
}<br />
drr2.Close();<br />
<br />
}<br />
private string ConnectionString<br />
{<br />
get<br />
{<br />
string connectionString = (@"Data Source=.\SQLEXPRESS;UID=sa;Password=*****;Initial Catalog=bd1");<br />
<br />
return connectionString;<br />
}<br />
}<br />
public string ContentTextBoxOfMasterPage<br />
{<br />
get { return Textbox1.Text; }<br />
}
defaul2.aspx
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" Title="Page sans titre" %><br />
<%@ MasterType virtualPath="~/MasterPage.master"%><br />
<br />
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"><br />
</asp:Content><br />
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><br />
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></asp:Content><br />
Default2.aspx.cs
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
TextBox2.Text = Master.ContentTextBoxOfMasterPage;<br />
}
MasterPage.master
<asp:TextBox ID="Textbox1" runat="server"></asp:TextBox><br />
<br />
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"><br />
</asp:ContentPlaceHolder><br />
</div><br />
</form><br />
</body><br />
</html><br />
But TextBox2 is empty.
thank you
|
|
|
|
|
And have you debugged and stepped through to ensure the code is working? Are you getting a value from the database?
A few tips:
DON'T hard code your connection string in your code, that is what the configuration file is for. See the element called connectionStrings? Guess what that is for.
If you are returning a single value than use ExecuteScalar
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hello;
the value of Textbox1 is 2010/2011 is retrieved from the database but the problem is to pass it to TextBox2.
Thank
|
|
|
|
|
You have got to give more information in your posts. We are not sitting next to you looking over your shoulder.
What do you mean "the problem is to pass it to TextBox2"? Is the datareader valid? Do you have a value to assign? Is the problem extracting the value from the textbox rather than assigning it?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Can you try, in Default2.aspx.cs : Page_Load
Control masterControl = Master.FindControl("TextBox1");
if(masterControl != null)
{
string textToCopy = (TextBox)masterControl.Text;
TextBox2.Text = textToCopy;
}
Debug, and let us know if 1) masterControl is not null and 2) if textToCopy gets populated
|
|
|
|
|
Hi;
I try:
Control masterControl = Master.FindControl("TextBox1");
if(masterControl != null)
{
string textToCopy = (TextBox)masterControl.Text;
TextBox2.Text = textToCopy;
} else{TextBox2.Text="rr";
} result:TextBox2 is empty
|
|
|
|
|
((Label)Master.FindControl("lblTopUpMsg")).Text = "Text in Chield Page";
Here lblTopUpMsg is a Label Name of Master page.
|
|
|
|
|
Hi,
I am mani. I have a problem in display the data in datagrid.
What i did is I am creating a form and in this form i created a 6 textboxes and one search button. whenever the user enter a text in textbox i retrieve the data from the database and displayed in the datagrid.
The problem is when the user again enter the text in text box the datagrid is filled with new data and last data will be lost. But i want that newly searching data should be displayed in datagrid including the last searching data.
If anyone knows the way how it should be doing please rly me. and provide an example in maintaing a datatable session variable.
regards,
manikanta.
|
|
|
|
|
This problem can be solved if u use datatable.
The data that was present on the data grid just fill this data to datatable and then the new searched data will also be filled in the same datatable then bind this datatable to the grid so that the previous data will not be lost.
|
|
|
|
|
Hi Mani,
in your problem, u can save your last data in datatable variable.
To use session variable,
Session["mySearchResult"] = searchResultTable;
searchResultGridView.DataSource = searchResultTable;
searchResultGridView.DataBind();
When u search new keyword and return data back from server, save it in temp table.
then retrieve your previous saved table from Session. and Loop through every row again
and add it into old table and re-save it to Session.
newSearchResultTable =
searchResultTable = Session["mySearchResult"] as DataTable;
foreach(DataRow row in newSearchResultTable.Rows)
{
searchResultTable.Rows.Add(row);
}
Session["mySearchResult"] = searchResultTable;
searchResultGridView.DataSource = searchResultTable;
searchResultGridView.DataBind();
Hint: when u enable the "EnableViewState " to false, your selected info will not be avaliable from the server.
Hope it works,
|
|
|
|
|
Dear all,
In my login page, im showing a captcha to the user ofter 3 unsuccessfull attempts.
this works fine, only if the user closes the browser and reopen it, the session is lost, so then he has again 3 chances to login without seeing the captcha.
i want to prevent this, i want still to show the captcha even in that case.
My question is, what is the best way to achieve that? by storing the ip address of the client? is it possible to get the ip address of the client always? even through proxies and firewalls?
Or maybe other suggestion?
Thanks in advance.
|
|
|
|
|
A client will always have an external IP even through firewalls and proxies but firewalls can be spoofed.
The main idea of a cpatcha is to prevent bots from auto creating accounts.
Another technique i saw was to create an empty input field and hide it, set it to an email type field , and if that field has a value on submit it means a bot attempted to sign up and you can deny the action
Chona1171
Web Developer (C#), Silverlight
|
|
|
|
|
Hi
Can anybody help me please.
when i try to login in my asp.net 4 page with the following source code an error returns:
DataTable dt = new DataTable();<br />
DataSet ds = new DataSet();<br />
SqlConnection sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["SN11ConnectionString"].ConnectionString);<br />
SqlCommand sqlCmd = new SqlCommand("SELECT UserId FROM [Users] WHERE ([Email]=@Email AND [Password]=@Password", sqlConn);<br />
SqlParameter paramEmail;<br />
paramEmail = new SqlParameter("@Email", SqlDbType.NVarChar, 25);<br />
paramEmail.Value = TextBoxLoginEmail.Text;<br />
sqlCmd.Parameters.Add(paramEmail);<br />
<br />
MD5CryptoServiceProvider md5Hasher = new MD5CryptoServiceProvider();<br />
byte[] hashedBytes;<br />
UTF8Encoding encoder = new UTF8Encoding();<br />
hashedBytes = md5Hasher.ComputeHash(encoder.GetBytes(TextBoxLoginPassword.Text));<br />
SqlParameter paramPwd;<br />
paramPwd = new SqlParameter("@Password", SqlDbType.Binary, 16);<br />
paramPwd.Value = hashedBytes;<br />
sqlCmd.Parameters.Add(paramPwd); <br />
<br />
sqlConn.Open();<br />
SqlDataAdapter sda = new SqlDataAdapter(sqlCmd);<br />
sda.Fill(ds);<br />
dt = ds.Tables[0];
Here is the error message that appears when i press the login button:
Incorrect syntax near '@Password'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near '@Password'.
Source Error:
Line 57: sqlConn.Open();
Line 58: SqlDataAdapter sda = new SqlDataAdapter(sqlCmd);
Line 59: sda.Fill(ds);
Line 60: dt = ds.Tables[0];
Line 61: }
Thank you.
|
|
|
|
|
Farhad Eft wrote: paramPwd = new SqlParameter("@Password", SqlDbType.Binary, 16);
SqlDbType.Binary for Password? Please check the data type.
|
|
|
|
|
yeah it's binary
because I'd like to store and retrieve the encrypted edition.
|
|
|
|
|
new SqlCommand("SELECT UserId FROM [Users] WHERE ([Email]=@Email AND [Password]=@Password", sqlConn);
u miss ")". check it.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
where did i miss it?
i can't see it!
|
|
|
|
|
OOPS!
yeah you are right
I'm such an idiot! lol
Thank you so much!
|
|
|
|
|
you're welcome. lol.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
I would think a hashed password, even of a password only a few characters long, might be considerably longer than 16 bytes? Not sure, but could that be the problem?
Edit: Sorry I think I have put you wrong. I was thinking the hex version of hashes possibly.
modified on Saturday, April 2, 2011 5:13 PM
|
|
|
|
|
hi, the problem is simple. look your sql deeply. there is an error
You sql = SELECT UserId FROM [Users] WHERE ([Email]=@Email AND [Password]=@Password
hope u got the mark.
there is a open bracket be the email which will fail the query result.
Good luck.
|
|
|
|
|
Hi
I have a DetailsView on the page and I have made one of the fields a TemplateField. In the EditItemTemplate and InsertItemTemplate I have a DropdownList that is databound to a table in my Sql Server database. I wanted to add an initial value to the DropdownList namely “- select -” .
I set the AppendDataBoundItems property to true and added the initial value as a ListItem.
Markup of the DropdownList
<asp:DropDownList ID="DropDownList_HP" runat="server"
AppendDataBoundItems="True" DataSourceID="SqlDataSource_HP"
DataTextField="Hospital" DataValueField="H_ID" SelectedValue='<%# Bind("H_ID") %>' Enabled="True">
<asp:ListItem>- select -</asp:ListItem>
</asp:DropDownList>
I also added a RequiredFieldValidator to ensure that a value is selected.
<asp:RequiredFieldValidator ID="RequiredFieldValidatorDV4" runat="server"
ControlToValidate="DropDownList_HP"
ErrorMessage="Select a referring hospital"
InitialValue="- select -" ValidationGroup="PatientInputGroupDV4" SetFocusOnError="True"></asp:RequiredFieldValidator>
This works fine for new input. The problem is however that the database already has records that were entered through a Windows Application and many of these records has a null value in this field and exceptions are thrown when I tried to open these records and the system tried to set the SelectedValue of the DropdownList.
After some more searching I found this help http://msdn.microsoft.com/en-us/library/ms366709.aspx
So I changed the ListItem in the DropDownList markup to the following:
<asp:DropDownList ID="DropDownList_RefHospDV4" runat="server"
AppendDataBoundItems="True" DataSourceID="SqlDataSource_RefHosp"
DataTextField="HospShort" DataValueField="HospID" SelectedValue='<%# Bind("HospID") %>' Enabled="True">
<asp:ListItem Selected="True" Value="">- select -</asp:ListItem>
</asp:DropDownList>
This now solved the problem of opening a record where the value is null in the database, BUT now the RequiredFieldValidator is not validating anymore to make sure that a databound item is selected for this field and not the initial value “- select -”. So basically now it is not checking anymore to see if valid input has been entered for the DropDownList and it accepts “- select -” thus it acts as if the field is not a required field anymore.
In short what is required is that I want to make sure that the user enters a valid selection in the DropDownList, but it must also cater for old records that do not have this field entered yet so that those old records can be opened in the DetailsView .
Opening Old records (with null in that field):
When these old records are opened in the DetailsView the DropDownlist should show “- select -” when the value in the database is null.
Saving records (old or new records):
When saving the record in Insert mode or Update mode the RequiredFieldValidator should show that a valid input is not selected if the DropDownList is still on “- select -”.
Does anyone have any solutions for me for the problem.
Regards.
Kobus
|
|
|
|