Click here to Skip to main content
15,306,585 members

Comments by pramod.hegde (Top 43 by date)

pramod.hegde 26-Jul-17 5:36am View
   
Well, its not a joke !!
If you observe, Header h = hp.Header; will give the document header object.
Later, one can easily 'set string' header to h.

FYI, without knowing the actual user code, providing a complete solution is not possible.

You have any better example ?? then use Solution box, not the Comment !
pramod.hegde 23-May-13 11:45am View
   
No. If you want the event handler to execute many times, then do not unsubscribe.
pramod.hegde 23-May-13 7:51am View
   
Your question is not clear. Is your equation an image?
Put some sample data.
pramod.hegde 23-May-13 7:48am View
   
First of all,
rchblknew.LayoutUpdated += new EventHandler<object>(mytest_LayoutUpdated);
this line of code, only subscribes to the event. It tells what is the handler (mytest_LayoutUpdated) when the event is raised.
Since you have subscribed the event thrice, mytest_LayoutUpdated method should get executed 3 times.

Just check whether you have unsubscribed the event anywhere in the handler code..
do you have something like this in the actual code.
rchblknew.LayoutUpdated -= new EventHandler<object>(mytest_LayoutUpdated);
pramod.hegde 23-May-13 6:45am View
   
Provide the actual query which you want to optimize.
pramod.hegde 26-Oct-12 11:36am View
   
This link might help you.
http://www.codeproject.com/Tips/370844/SQL-Import-Data-from-Excel
pramod.hegde 26-Oct-12 11:35am View
   
Please improve your question.
Where you are trying to catch the exception?
In the client side (where you are referencing WCF service)
OR
In the WCF service itself?
pramod.hegde 25-Oct-12 6:41am View
   
GridViewRow row = (GridViewRow)chkStatus.Parent; would give you the cell. You should have its Parent where you get GridViewRow.
i.e. GridViewRow row = (GridViewRow)((DataControlFieldCell)chkStatus.Parent).Parent;

I suggest you to debug the code properly.
pramod.hegde 31-Aug-12 4:58am View
   
This still works with HTML.
pramod.hegde 31-Aug-12 2:13am View
   
[DataContract]
public class Result
{
[DataMember]
public List<TrainDetails> Details{ get;set;}

[DataMember]
public String ModeType { get;set;}
}

public Result GetDataUsingMethodList()
{
// have the required details here
dataTable = new DataTable();
cmd.Connection = conn;
cmd.CommandText = "SELECT * FROM tbl_TrainDetails";
ad = new SqlDataAdapter(cmd);
ad.Fill(dataTable);
List<TrainDetails> TrainD = new List<TrainDetails>();
for (int i = 0; i < dataTable.Rows.Count; i++)
{
TrainDetails td = new TrainDetails();
td.TrainNumber1 = Convert.ToInt32(dataTable.Rows[i] ["TrainNumber"].ToString());
td.TrainName1 = dataTable.Rows[i]["TrainName"].ToString();
td.FromStation1 = dataTable.Rows[i]["FromStation"].ToString();
td.ToStation1 = dataTable.Rows[i]["ToStation"].ToString();
td.Depature1 = dataTable.Rows[i]["Depature"].ToString();
td.Arrival1 = dataTable.Rows[i]["Arrival"].ToString();
td.Status1 = dataTable.Rows[i]["Status"].ToString();
TrainD.Add(td);
}

return new Result()
{
Details = new List<TrainDetails>(TrainD),
ModeType = "SomeModeType"
};
}
pramod.hegde 31-Aug-12 1:50am View
   
Hi,
Use WCFTestClient to test this service and to get the exact output. This is a tool which comes with Visual Studio.
It will be available in
..\Microsoft Visual Studio 10.0\Common7\IDE\WcfTestClient.exe (10.0 is what i am using..check your version number and search for WcfTextClient)
pramod.hegde 31-Aug-12 1:20am View
   
Use GZip library.
pramod.hegde 28-Aug-12 8:37am View
   
Refer this thread
http://www.codeproject.com/Tips/366446/Export-GridView-Data-to-Excel-using-OpenXml
pramod.hegde 28-Aug-12 8:19am View
   
Are you talking about intellisense? Yes. Visual Studio has intellisense even for javascript.
pramod.hegde 28-Aug-12 8:10am View
   
Did you try to check what does 'dt.Rows[i + 1][1].ToString()' return? Check whether it contains any Boolean value OR String OR DateTime (it fails in all these cases).
pramod.hegde 28-Aug-12 7:54am View
   
You cannot hide it. But .net provides one more option. You can encrypt it and send it. While in the receiving page, you need to decrypt it and use it.
http://www.codeproject.com/Articles/33350/Encrypting-Query-Strings
pramod.hegde 27-Aug-12 15:01pm View
   
I have updated the query with 'order by' clause.
pramod.hegde 27-Aug-12 14:55pm View
   
The requirement was only for group by. :)
However you can do order by also.

select Tax%, SUM(AMOUNT), SUM(TAXAMOUNT)
from Accounts
group by Tax%
order by Tax%
pramod.hegde 27-Aug-12 7:54am View
   
Give [STAThread] attribute on public void syncRead() as well.
pramod.hegde 27-Aug-12 7:52am View
   
If you are creating excel file from data base why not creating it in office 2007 format itself?
You can use Office Open XML SDK to do so.
http://openxmldeveloper.org/
pramod.hegde 27-Aug-12 6:38am View
   
Calling WCF comes later.
First check, this javascript function is getting called or not.
Couple of points:
1. Syntax Fix:
Option 1. $(document).ready(function(){...} should be loaded when the form/body of the page loads. Not at the point when you click on any button. The syntax does not look proper here. Fix this first.
Option 2. Completely remove $(document).ready(function(){ line. This is no longer needed.
Option1 needs slightly more modification than Option2. So better you fix the syntax using Option2.
2. WCF Service/Binding:
To call WCF Service, check the type of the service. It should be AjaxEnabledWCF service. Also check the binding. It should be webHttpBinding.
3. Service Return type:
You are expecting the response as 'json'. Check the service response type. It should be 'JSon'.
pramod.hegde 27-Aug-12 5:07am View
   
Then you might need to write the logic by your own.
Something like this,

Person[] personList = new Person[4]; // fill this

int n=personList.Length;
Person temp = null;

for (int i = 0; i < n-1; i++)
{
for (int j = i + 1; j < n; j++)
{
if (personList[i].Rank < personList[i].Rank)
{
temp = personList[i];
personList[i] = personList[j];
personList[j] = temp;
}
}
}

This will sort according to the Rank.
pramod.hegde 27-Aug-12 3:03am View
   
You need to refer CrystalDecisions.CrystalReports.Engine dll in your project.
Also, check for the right version Version=13.0.2000.0.
The error might be because of missing dll or improper version. Please check & fix these.
pramod.hegde 24-Aug-12 5:01am View
   
You need to have respective api's
http://www.codeproject.com/Articles/380635/Csharp-Application-Integration-with-Facebook-Twitt
pramod.hegde 24-Aug-12 4:34am View
   
Check the modified solution in Solution2.
i <= ds.Tables[0].Rows.Count has been modified to
i < ds.Tables[0].Rows.Count.

Now you should not get any errors.
pramod.hegde 23-Aug-12 8:20am View
   
Use LststateList.SelectedItem
pramod.hegde 23-Aug-12 7:08am View
   
You need Windows Service and a scheduler. Install this service and schedule it when it has to run. Write your code in the service.
pramod.hegde 23-Aug-12 6:39am View
   
Are you trying to insert the record for the same StudentID? If StudentID is a primary key, then the insert statement would fail, as primary key should be unique.
pramod.hegde 23-Aug-12 5:07am View
   
Post the code which you have tried.
pramod.hegde 23-Aug-12 5:07am View
   
Deleted
<pre lang="cs">var Lqry = from A in DC.CLRN_Tables
join B in DC.CLRN_Tables2 on R.ID equals B.ID
where (A.STATUS == "1") && (B.iStatus == 1)</pre>
pramod.hegde 23-Aug-12 5:07am View
   
Deleted
Post the code which you have tried.
pramod.hegde 23-Aug-12 4:44am View
   
Please elaborate the problem. Post some part of the code. This is not that clear.
pramod.hegde 23-Aug-12 4:32am View
   
Be clear what you want to say. Elaborate your problem.
pramod.hegde 22-Aug-12 8:25am View
   
Hi,
Have you tried like this,

<div style="height:150px;">
<div style="height:100px;">
<asp:Chart ID="Chart1" runat="server">
<series>
<asp:Series Name="Series1">


<chartareas>
<asp:ChartArea AlignWithChartArea="NotSet" Name="ChartArea1" BorderColor="Red" AlignmentStyle="PlotPosition">



</div>
<div style="height:50px;">
<asp:Chart ID="Chart2" runat="server">
<series>
<asp:Series Name="Series2">


<chartareas>
<asp:ChartArea AlignWithChartArea="NotSet" Name="ChartArea2" BorderColor="Red" AlignmentStyle="PlotPosition">



</div>
</div>

I have tried and this works perfectly fine.
pramod.hegde 22-Aug-12 8:18am View
   
Hi,
All you are doing is viewing the generated html file. So, do not use Process.Start('filePath'). Instead use window.open('html file').
pramod.hegde 22-Aug-12 4:45am View
   
You can download it from microsoft site.
http://download.microsoft.com/download/2/7/F/27FF6744-D970-4FFB-90B8-5226B2B82E0A/OpenXMLSDKv2.msi
pramod.hegde 22-Aug-12 3:37am View
   
Please share the code what you have tried. The link which I sent does excel to sql bulk insert.
So, if I'm not wrong you are trying to add more number of students into the table by uploading excel file from asp.net and then inserting excel data to sql table. Then by refreshing the grid view to display the newly inserted data.
If this is correct, then you can make us of the above approach to do so.

Please share the erroneous code you have. Let me help you if you face any problem.
pramod.hegde 22-Aug-12 3:27am View
   
Yes. you need to add class attribute to td.

$("#SampleGrid").append("<table><tbody><tr><td class="photo">" + customers[i].Column1 +
"</td><td>" + customers[i].Column2 + "</td></tr></tbody></table>");
}
pramod.hegde 22-Aug-12 3:20am View
   
Off course it is a namespace. You can look into this namespace, where you find ThreeServiceRefClient class. Create the object of ThreeServiceRefClient class instead of ThreeServiceRef.
pramod.hegde 22-Aug-12 3:18am View
   
Where is '.photo'?
Looks like this is a 'class' attribute. You can add such attributes while creating <td>, like <td class="photo">. So, what it does is, when you click on this cell, it will show an alert box with message 'asd' in it.
pramod.hegde 22-Aug-12 2:45am View
   
You can use this.

string excelfile = Path.GetTempPath() +
Guid.NewGuid().ToString() + ".xlsx";
using (SpreadsheetDocument excelDoc = SpreadsheetDocument.Create(
excelfile,
DocumentFormat.OpenXml.SpreadsheetDocumentType.Workbook))
{
CreateExcelParts(excelDoc, table);
}
return excelfile;

and 'table' should be of type DataTable. so, all you need to do is, create DataTable from sql and pass it to this method.
pramod.hegde 22-Aug-12 2:38am View
   
Hi,
You need to use ConfigurationManager.ConnectionStrings. Before that, you need to refer System.Configuration dll if it is referred.
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["DBEntities"].ConnectionString);
pramod.hegde 22-Aug-12 2:28am View
   
Then change gridview to div.
<asp:GridView ID="SampleGrid" runat="server" >

to
<div id="SampleGrid" />

That's it.