|
Hai Abhijith,
I got it,Thanks for the response and sorry for the bad posting
|
|
|
|
|
Hi,
there was no code...what was the problem...?
S Kumar
|
|
|
|
|
Hai Kumar,
Thanks for the response,i got hte solution, sorry for the bad posting
|
|
|
|
|
with out doing any serialization can i use the class created by the xsd in two projects to communicate between two.
|
|
|
|
|
Well, you can, but you need to define how. How do you expect to send a class instance from one project to another ? What sort of projects are they ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
what i intend to do is after creating the class from xsd and add them to both projects manually
|
|
|
|
|
can any one guide me on creating common classes for two applications.
|
|
|
|
|
Craete a dll with your class in and reference it in both projects.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
I want to apply stylesheet to the HTML format of mail.
I dont want to use code like :
string strBody="";
strBody += "<table><tr><td style='font-family: Verdana; font-size: 10pt;'>Hi,";
strBody += "</td></tr></table>";
Instead of that want to use :
string strBody="";
strBody += "<table><tr><td class='verdanaText'>Hi,";
strBody += "</td></tr></table>";
ObjMail.BodyFormat=MailFormat.Html;
ObjMail.Body=strBody;
Is it possible to use what I expected??
|
|
|
|
|
Deepml wrote: Instead of that want to use :
string strBody="";
strBody += "";
ObjMail.BodyFormat=MailFormat.Html;
ObjMail.Body=strBody;
Did you check it? How it will get class='verdanaText' . You have to write the cssclass also with the BodyString.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Abhijit Can you please tell me how to write that cssClass with Bodystring,I mean how to write
|
|
|
|
|
<blockquote class="FQ"><div class="FQA">Deepml wrote:</div>mean how to write <link href="../includes/style.css" type="text/css" rel="stylesheet"> </link></blockquote>
Not, its not like that.
I want to mean, Create a mail content file like
<html>
<body>
<style>
.FontHeaderStyle
{
font-size: 12px;
font-family: verdana;
color:#C41230;
}
</style>
<table>
<tr>
<td class="FontHeaderStyle">
This is Sample HTML Mail
</td>
</tr>
</table>
</body>
</html>
Now, read the content as Text Reader and put it in mail body. Hope this is not clear to any. Any doubts ?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Thanks Abhijit.. I got it 
|
|
|
|
|
Go ahead.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Hi,
I have a DataGrid and i am using the code below to read it.It is reading all the records and working fine.But if i want to read only the recods that are currently displaying the grid(for grid paging is there and at a time it is displaying 10 records).After that i am inserting this to excel file.According to the paging i want the recods to insert in excel(ie 1-10 or 10-20 or 30-40) What should i change in the code? Thanksin advance
public void ExportDataToExcel(DataTable datatable, string[] Headers, string SourcePath, string DestinationPath)
{
int i, j;
string strSourceTemplate = "";
string strDestFileName = "";
string strHeaders = "";
string strRow = "";
System.Data.OleDb.OleDbConnection objXlsCon = null;
System.Data.OleDb.OleDbCommand objCmd;
try
{
objXlsCon = new System.Data.OleDb.OleDbConnection();
if (datatable.Rows.Count > 0)
{
strSourceTemplate = SourcePath;
strDestFileName = DestinationPath;
System.IO.File.Copy(strSourceTemplate, strDestFileName);
objXlsCon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strDestFileName + ";Extended Properties=\"Excel 8.0;HDR=Yes;MAXSCANROWS=1;\";";
objXlsCon.Open();
objCmd = new System.Data.OleDb.OleDbCommand();
objCmd.Connection = objXlsCon;
for (i = 0; i < Headers.Length; i++)
{
strHeaders += Headers[i].ToString() + ",";
}
string s=datatable.Columns[0].ColumnName;
int k=0;
foreach (DataRow drow in datatable.Rows)
{
for (j = 0; j < datatable.Columns.Count; j++)
{
if(Headers.Length > k)
{
if(datatable.Columns[j].ColumnName == Headers[k].ToString())
{
if(drow[j].ToString() != "" )
{
strRow += drow[j].ToString() + "','";
}
else
{
strRow +="-'"+",'";
}
k++;
}
}
}
objCmd.CommandText = "Insert into [Sheet1$] (" + strHeaders.Substring(0, strHeaders.Length - 1) + ") values ('" + strRow.Substring(0, strRow.Length - 3) + "')";
objCmd.ExecuteNonQuery();
strRow = "";
j = 0;
k=0;
}
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
objCmd = null;
objXlsCon.Close();
}
}
|
|
|
|
|
Hi,
You can use this code,it directly exports only the current records of the page
Response.ClearContent()
Response.AddHeader("content-disposition", "attachment;filename="& Your File Name & ".xls")
Response.Charset = ""
Response.ContentType = "application/vnd.xls"
Dim stringWriter As New System.IO.StringWriter()
Dim htmlWrite As New System.Web.UI.HtmlTextWriter(stringWriter)
'dgview is your datagrid
dgview.AllowPaging = true
dgview.DataSource = Your Data Source
dgview.DataBind()
dgview.RenderControl(htmlWrite)
Response.Write(stringWriter.ToString())
Response.End()
and also you can apply some styles for excel sheet....
Hope this will help you...
S Kumar
|
|
|
|
|
Hai,
I am using c# ,and no idea about vb. If some other code or idea is there, pls share.In my code the foreach loop is searching for the whole recods.What should i change there?
foreach (DataRow drow in datatable.Rows)
{
for (j = 0; j < datatable.Columns.Count; j++)
{
if(Headers.Length > k)
{
if(datatable.Columns[j].ColumnName == Headers[k].ToString())
{
if(drow[j].ToString() != "" )
{
strRow += drow[j].ToString() + "','";
}
else
{
strRow +="-'"+",'";
}
k++;
}
}
}
Thanksss
|
|
|
|
|
hi,
i think instead of for each you can use for loop
and you have to pass the records number (ie; 1-10,11-20) based on the current index page of datagrid....
or else convert my previous code to C#.NET ,that is working fine for me ...
S Kumar
modified on Friday, March 13, 2009 5:12 AM
|
|
|
|
|
i have a web service(A) and web application (B) . B calls methods in A, for method A.X(Customer) i use the customer object which is created by XSD. after creating the Customer class by the XSD i added this file to both A and B. but when i call X() method from B it request an object of type A.Customer. it's not accepting an object type of Customer .what might be the problem.any idea.
|
|
|
|
|
Are the two the same? Try having them share the same class Customer. Hard to tell what is going on without some code...
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
i created the Customer class using the same XSD.this Customer class is added to both web app and web service.
as u suggested how can i share the same class
|
|
|
|
|
Add a new project to the solution and have them share that project.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
as u suggested if i create a new project and let it be shared by both , then both keep references, this cannot be allowed, what i want is, both should be able to this Customer object, what is the possible way.
|
|
|
|
|
The update on this problem is that now I have created a masterpage in a new project that contains the same layout as in my website project. In the test project the accordion works. When I move the page and the master page from the test project into my website project it does not work!!
When I do a view source on the page that works and the page that does not I see a difference in the the line
onsubmit="javascript:return WebForm_OnSubmit();"
from the line in the page that does not work:
the section for SAME PAGE and SAME MASTER PAGE - different projects????
Original post was as follows:
Accordion working on page but when put in contentpage of a masterpage it doesn't. What is the solution? I have tried everything and it is not apparent to me. This question has been asked many times in the internet, but no answers. Help please. A good suggestion would be appreciated.
This page is an accordion on a contentpage I believe.
Ok - I have created a new test project and I have the contentpage with the accordion and 4 panes and it works, but when I move the page to my website project it does not. The only difference is the masterpage. In my website I have login controls, themes, and a menu. The scriptmanager is in the masterpage even in my test project.
Getting closer - surely I am not the only person that has had this problem.
|
|
|
|
|
I have seen this happen when your DOCTYPE is different on the two different pages.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|