|
Did you put that in the ViewHomeTaskStatus method?
The only reference that can be null in the code where you get the exception now, is the data set. It always has a Tables collection, if there was no tables you would get a different exception, and a table always has a Rows collection. So, the conclusion is that a data set is never returned from the method, and that only happens if there is an exception.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi i changed the way in which am getting the output i vchanged the getdataset into .Executescalar now
|
|
|
|
|
So the problem was in the GetDataSet method?
Did you change the exception handling? Did you find out what the actual problem was?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
No am not getting the output still nor able to find out the mistake
|
|
|
|
|
susan_151615 wrote: (View Home Task Status is a function which will call the SP)
Is there a problem with this function?
|
|
|
|
|
I think your way of approach is quite too complex for that task. If your aim is to show the rows that the user has checked in some other page, you could better take the ids of the checked rows, into a session variable and use a simple query just like the query which loads the grid in the first page with an extra where condition for the ids, so the ones that are selected alone will come. This should do ur task, it is strongly suggested that you dont take such values to database, just to show stuff in corresponding pages.
And infact you can even do this with no database hit (for this purpose) in the second page, just take all the values of the selected rows into a datatable and take that datatable to the next page through session, but the session size will become heavy.
Both the above ways are where your project allows to handle values in session, if that is not the case, you can try cookies too. and worst case your db method could help, and in your case, see whether the values u check are inserted in the table and use break points and see whether all the tables and rows that you want are in the dataset you are returned with.
|
|
|
|
|
HI ya what u r telling is correct .Since i dono how to implement that functionality and quite little bit tough am following this mehthod.And now my problem is no error is coming the SP is not working fine i think i dono whats the problem
the think in backend when i checked the SP its working through front end on button click the SP is not working fine
|
|
|
|
|
i am building a category tree like structure for my FAQ app. i need to show all active categories. The hitch is that
if a parent category is checked as inactive, then the sub or child categories under it should not be displayed even if they
are marked as active. I need a query which will return me such a resultset which i can display in a table. the columns in my
table are categoryid, category, ParentcategoryID,companyID and active. The ParentcategoryID contains id of another category
or 'No parentcategory' which denotes its the main category. It is easy to get the immediate parentcategory and find out if
its active or not. But to find out if that parent category's parent and so on is active or not is tough. please help.
|
|
|
|
|
HY
I m using de following code to send an email...
protected void btnSend_Click(object sender, EventArgs e)
{
Response.Write("hy");
MailMessage msg = new MailMessage();
msg.To = txtTo.Text;
msg.From = txtFrom.Text;
msg.Subject = txtSubject.Text;
msg.Body = txtContent.Value;
lblStatus.Text = "Sending...";
SmtpMail.SmtpServer = "smtp.gmail.com";
SmtpMail.Send(msg);
lblStatus.Text = "Sent email (" + txtSubject.Text + ") to " + txtTo.Text;
}
}
I dnt get a run time error......5305.7.0 MUST ISSUE STARTTLS COMMAND FIRST ....
plz help..
regards
modified on Wednesday, October 29, 2008 3:27 AM
|
|
|
|
|
I think the problem is the fact you are trying to use mail.hotmail.com try adding your Credentials to the sending, if not find a different SMTP Server
<br />
public Send Mail()<br />
{<br />
MailMessage message = new MailMessage("Send to Addr", "From Address", "Subject", "Message");<br />
message.IsBodyHtml = true;<br />
SmtpClient emailClient = new SmtpClient("Othe SMTP");<br />
emailClient.UseDefaultCredentials = false;<br />
System.Net.NetworkCredential basicAuthenticationInfo = new System.Net.NetworkCredential("YourSmtpUserName something@yourhost.com", "emailpassword");<br />
emailClient.Credentials = basicAuthenticationInfo;<br />
emailClient.Send(message);<br />
}<br />
|
|
|
|
|
Hy,thankz for replyng to my message....I had used aonther code ...
protected void btnSend_Click(object sender, EventArgs e)
{
Response.Write("hy");
MailMessage msg = new MailMessage();
msg.To = txtTo.Text;
msg.From = txtFrom.Text;
msg.Subject = txtSubject.Text;
msg.Body = txtContent.Value;
lblStatus.Text = "Sending...";
SmtpMail.SmtpServer = "smtp.gmail.com";
SmtpMail.Send(msg);
lblStatus.Text = "Sent email (" + txtSubject.Text + ") to " + txtTo.Text;
}
}
i get an error dat i sould issue an STARTTLS command first...can u recommend de changes dat i should make...
should i make any changes in de VIRTYAL SMTP SERVER and create a neew connection..
regards
|
|
|
|
|
Hi,
here is my code, which is same as your one. but not working as System.Net.Mail classes doesn't support SMTPS.
SmtpClient client = new SmtpClient("smtp.gmail.com", 465);
MailMessage mail_msg = new MailMessage();
MailAddress fromAdd = new MailAddress(tbFrom.Text.Trim());
mail_msg.From = fromAdd;
mail_msg.To.Add(new MailAddress(tbTo.Text.Trim()));
mail_msg.Subject = tbSubject.Text;
mail_msg.IsBodyHtml = true;
mail_msg.Body = "Message From: " + tbFrom.Text.Trim() + "Subject:" + tbSubject.Text.Trim() + "Email: " + tbTo.Text.Trim() + "Content: " + tbContent.Text.Trim();
System.Net.NetworkCredential basicCredential = new System.Net.NetworkCredential(tbFrom.Text, "my password");
client.EnableSsl = true;
client.UseDefaultCredentials = false;
client.Credentials = basicCredential;
client.Send(mail_msg);
Himanshu Manjarawala.
Sr. Software engineer @AutomationAnywhere
http://www.himanshumbi.blogspot.com
http://www.fieredotnet.wordpress.com
|
|
|
|
|
What .net Framework you using also add your account details to the smtpClient the code I gave you last answer works everytime.
|
|
|
|
|
Hi I am building a access restriction system into my logon and it work great for IPv4 only allow access to pcs with the following IP's 172.74.20.x but how does this work with IPv6? fe80::91da:172b:26fe:994d%10 ????
Thanks
|
|
|
|
|
I have two text box. one is for name and another for Address.
In name text box i want insert not more than 15 characters(alphabet). and in address I want insert 55 characters.
I use in name textbox:
D[a-zA-Z]*
It prints name in alphabet but it takes more than 15 characters.
Please guide me.
thanx
|
|
|
|
|
You should buy a book on regular expressions, or do some reading. There's a windows program called Expresso that will also help. You can enter as many chars as you like b/c that is exactly what the * means.
Christian Graus
Driven to the arms of OSX by Vista.
"Iam doing the browsing center project in vb.net using c# coding" - this is why I don't answer questions much anymore. Oh, and Microsoft doesn't want me to.
|
|
|
|
|
|
Thanks.
but this query is not accept white space character
|
|
|
|
|
|
Hi all,
How to get the Gridview data (after binding the gridview) into DataTable ?
I tried in the following way. But its giving Exception Unable Convert 'System.Web.UI.WebControls.GridViewRowCollection' to 'System.Data.DataRow'
DataTable dt= new DataTable();
foreach(DataRow drow in Gridview1.Rows)
{
dt.Rows.Add(drow);
}
Please suggest me how to do that.
Thanks in advance.
modified on Wednesday, October 29, 2008 2:32 AM
|
|
|
|
|
Try this:
foreach(GridViewRow drow in GridView1.Rows)
{
dt.Rows.Add(drow);
}
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Thanks for your suggestion.
I will try that.
|
|
|
|
|
Hello Meeram395,
I tried. But i got exception
System.ArgumentException: Input array is longer than the number of columns in this table.
foreach(GridViewRow drow in GridView1.Rows)
{
dt.Rows.Add(drow); //Here i got the above exception
}
|
|
|
|
|
Hello meeram395,
I solved the that exception.
But I am getting empty datarows. DataItem : null
My logic:
BindGridview();
DataTable dt = new DataTable();
dt.Columns.Add();
foreach (GridViewRow dr in GvReport.Rows)
{
dt.Rows.Add(dr); // I am getting the row count as 10. But DataItem is null
}
|
|
|
|
|
I have tried as below and getting the results successfully:
DataTable dt = new DataTable();
dt.Columns.Add();
dt.Columns[0].ColumnName = "User Name";
dt.Columns.Add();
dt.Columns[1].ColumnName = "User Email";
foreach (GridViewRow row in SearchGrid.Rows)
{
DataRow dr = dt.NewRow();
dr["User Name"] = row.Cells[1].Text;
dr["User Email"] = row.Cells[2].Text;
dt.Rows.Add(dr);
}
Hope this helps.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|