|
i get the value f my field. it is contain ""
my code is this form:
drMyRow["reqDesc"] = item["xxx"].ToString();
after that drMyRow["reqDesc"] = hi
now i want dont show
what do i do
i want show drMyRow["reqDesc"] = hi
modified on Monday, January 11, 2010 5:08 AM
|
|
|
|
|
hii am trying to send email using smtp.net.mail namespace.
I have written the appropriate code for it in vb.net bu t am getting following error.
"No connection could be made because the target machine actively refused it (ip address)"
what shud i do....plz guide../
|
|
|
|
|
can we see the code ?
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
i have written the following code:
Dim message As MailMessage = New MailMessage()
message.From = New MailAddress("xyz@jmfinfotech.com")
message.To.Add(New MailAddress("xyz@gmail.com"))
message.Subject = "Yous Selection:"
message.Body = "You have selected following options:" + txtselection.Text
Dim client As SmtpClient = New SmtpClient()
client.Send(message)
and web config code:
<system.net>
<mailSettings >
<smtp>
<network host="smtp.1and1.com" port="25" userName="xyx" password="123" defaultCredentials="true"/>
</smtp>
</mailSettings>
</system.net>
but getting error:target machine actively refused (ipaddress).tell me what to do plz guide...
|
|
|
|
|
mylogics wrote: smtp.1and1.com
may not be running or if it is running the port might not be correct. Please check with your Email Administrator/Helpdesk for more assistance.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Hi all,
I have a Gridview that I populate with values from textboxes. These populated values doesn't have any ID. I can edit and update records but I don't know how to delete records. Please advice on how I can achieve this.
P.S: These records are NOT being saved on the database, only on the Gridview.
I'll appreciate any help I can get.
Thanks.
|
|
|
|
|
What is the datastore that you use to populate the gridview. If you can share the logic that you use for edit then we can avoid reinventing the wheel.
|
|
|
|
|
I'm using dataTable as staorage and then I save it in a Session. Here is the code.
private void DataBindGrid()
{
try
{
string checkflag;
//Create DataTable.
DataTable dt = (DataTable)Session["dtInfoProfile"];
if (dt == null)
{
//Create DataTable.
dt = new DataTable();
//Assign Columns to it.
dt.Columns.Add(new DataColumn("Full Names"));
dt.Columns.Add(new DataColumn("Type"));
dt.Columns.Add(new DataColumn("Identifying Number"));
dt.Columns.Add(new DataColumn("Passport Number"));
}
//Create a DataRow by dt.NewRow().
DataRow dr = dt.NewRow();
if (rdbIndividual.Checked)
{
//Fill that row and add it to datatable.
checkflag = rdbIndividual.Text;
dr["Full Names"] = IndividualDetailsControl.FirstName + " " + IndividualDetailsControl.LastName;
dr["Type"] = checkflag;
dr["Identifying Number"] = IndividualDetailsControl.IdentityNo;
dr["Passport Number"] = IndividualDetailsControl.PassportNo;
dt.Rows.Add(dr);
}
else if (rdbTrust.Checked)
{
checkflag = rdbTrust.Text;
//Fill that row and add it to datatable.
dr["Full Names"] = EntityDetailsControl.Name;
dr["Type"] = checkflag;
dr["Identifying Number"] = EntityDetailsControl.RegistrationNo;
dt.Rows.Add(dr);
}
else
{
checkflag = rdbEntity.Text;
//Fill that row and add it to datatable.
dr["Full Names"] = EntityDetailsControl.Name;
dr["Type"] = checkflag;
dr["Identifying Number"] = EntityDetailsControl.RegistrationNo;
dt.Rows.Add(dr);
}
Session["dtInfoProfile"] = dt;
//Bind GridView Here with this Table
this.BindData();
//Rename the button
btnAdd.Text = "Add New";
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
private void BindData()
{
dgInfoProfile.DataSource = Session["dtInfoProfile"];
dgInfoProfile.DataBind();
}
For Edit and Update:
//Edit
protected void dgInfoProfile_RowEditing(object sender, GridViewEditEventArgs e)
{
//Set the edit index.
dgInfoProfile.EditIndex = e.NewEditIndex;
//Bind data to the GridView control.
this.BindData();
}
//Update
protected void dgInfoProfile_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
//Retrieve the table from the session object.
DataTable dt = (DataTable)Session["dtInfoProfile"];
//Update the values.
GridViewRow row = dgInfoProfile.Rows[e.RowIndex];
dt.Rows[row.DataItemIndex]["Full Names"] = ((TextBox)(row.Cells[1].Controls[0])).Text;
dt.Rows[row.DataItemIndex]["Type"] = ((TextBox)(row.Cells[2].Controls[0])).Text;
dt.Rows[row.DataItemIndex]["Identifying Number"] = ((TextBox)(row.Cells[3].Controls[0])).Text;
dt.Rows[row.DataItemIndex]["Passport Number"] = ((TextBox)(row.Cells[4].Controls[0])).Text;
//Reset the edit index.
dgInfoProfile.EditIndex = -1;
//Bind data to the GridView control.
this.BindData();
}
|
|
|
|
|
I didn't have the time to experiment, but I think GridViewDeleteEventArgs e is available on the Row Delete event and you can use it to retrieve the row id.
If that is not possible, how about altering the code to add one more value as an identifier and setting the value as the command value for a command button and delete the row corresponding to the command value?
HTH!
|
|
|
|
|
yes, the GridViewDeleteEventArgs e is available but i don't understand where I can get the value of an index, or of an Id if I add another Id column?
|
|
|
|
|
I assume GridViewDeleteEventArgs e has a row index just like the Update event arg. So, you can use it to get the gridview row and use it to get the datatable row just like what you have done for edit.
I've just got these out of the original code that you posted and modified it slightly -
GridViewRow row = dgInfoProfile.Rows[e.RowIndex];
dt.Rows[row.DataItemIndex].Remove();
Try on these lines and I'm sure you must be able to get it to work!
|
|
|
|
|
Thanks. There are two event for delete, one is RowDeleting and the other is RowDelete. I tried with RowDeleting. they both don't have Remove() method, thereforre i tried Delete().
GridViewRow row = dgSendFeedbackTo.Rows[e.RowIndex];
dt.Rows[row.DataItemIndex].Delete();
I get the following error when debugging:
"There is no row at position 1."
|
|
|
|
|
I'm sorry Nopo, I don't have access to VS at this point it time so I cannot help you out on the error message.
But, going by the looks of it try reducing the value of DataItemIndex . May be it might work.
|
|
|
|
|
Hi Dinesh,
I've got it right.
protected void dgSendFeedbackTo_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
DataTable dt = (DataTable)Session["dtFeedback"];
dt.Rows[e.RowIndex].Delete();
this.BindData();
}
Thanks a lot for all your help.
|
|
|
|
|
|
I am using cookies to remember userid and password .It works fine.
I am using ImageButton Conrol instead of simple button.
my problem is that when i click image button, remembered password is going to blank (IE)
In mozilla it not happened but first time button click event is not fired when i click second time
then button event fire.(it means we have to click image button two times )
|
|
|
|
|
I haven't meet this problem。
|
|
|
|
|
Hello Everyone,
I have an image box in an ASP.NET page. I have a button on that page. When user clicks on the button, an open file dialogue box will appear and the selected picture will be shown in the image box. Can anyone help me by providing the codes of that.....
|
|
|
|
|
what's your Email?I will send a example to you!
|
|
|
|
|
Thax 4 ur reply.
My e-mail: jahidbbd@gmail.com
|
|
|
|
|
In my aspx page, when I try to debug the application, there are some int variables which shuld give the value in int. However, when i checked the value at the time of debugging, I am getting the values like 0x00002713, 0x000000, 0x00005249 etc. Not sure what this is meant. This is happening very recently.
I didn't change any settings. Any idea what is happening? Even there is a count variable which is also giving the value in above format? I don't know how to fix this? Can anybody please help me on this?
Thanks
meeram395
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
The values are being displayed in Hexadecimal format. You might have enabled the 'Hexadecimal Display' for the watch. Rt click on the watch window and uncheck the 'Hexadecimal Display' menuitem.
|
|
|
|
|
Yeah. Thanks very much. It got worked.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi Peoples,
In asp to go to other URL we will give like
Response.Redirect("www.CodeProject.com"), this will
open the code project site in the same page(same browser)
but i need the same in the new window
(i.e like Open in New Window (right click
of the IE browser))
i googled and find that it can be done bye windoe.open() as java script,
but as window.open() may be blocked by pop up blocker,
i need you peoples help,
how to do the same in C#.net.
help me thanks in advance
|
|
|
|
|
Please have a look at this
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|