Search Results

Search found 172 results on 7 pages for 'colin mcqueen'.

Page 4/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • Ajaxing a link in a table

    - by Colin Desmond
    I have a table of results in an ASP.Net MVC page where the last column is an View Details link. I want to have the user click the View Details link and an AJAX method be called to open the results in floating dialog. What I am struggling with is how to link the AJAX call to the link in the results table. I was using a link which embedded the ~/ControllerName/ViewDetails/InstanceId link directly in it. Clicking it took the user to a new page and it is this behaviour I want to replace with an AJAX call and a dialog window. Now I want to attach a jQuery handler to the link to trigger the AJAX call and I can't see how to do this other than write an jQuery handler for each row in the results table. There must be a way to mark the link as an ViewDetails link (using a class?) and attach the jQuery click handler to all instances of type class ViewDetails.

    Read the article

  • Visual Studio Plug-in that can tell the Application Pool name of w3wp.exe when debugging

    - by Colin Niu
    Is there any plug-in for Visual Studio that can display the associated Application Pool name for those w3wp processes when debugging them with "Attach to Process..." ? Usually I have to do following steps before debugging: c: \Windows\system32\inetsrv\appcmd list wps then I get the process id for the Application Pool I want to debug, and then attach it in the Attach to Process window. I feel it will be very pleasure if there's a plug in can do this automatically, but didn't find any such thing after Googled.

    Read the article

  • Mapping a child collection without indexing based on database primary key or using bag

    - by Colin Bowern
    I have a existing parent-child relationship I am trying to map in Fluent Nhibernate: [RatingCollection] -- [Rating] Rating Collection has: ID (database generated ID) Code Name Rating has: ID (database generated id) Rating Collection ID Code Name I have been trying to figure out which permutation of HasMany makes sense here. What I have right now: HasMany<Rating>(x => x.Ratings) .WithTableName("Rating") .KeyColumnNames.Add("RatingCollectionId") .Component(c => { c.Map(x => x.Code); c.Map(x => x.Name); ); It works from a CRUD perspective but because it's a bag it ends up deleting the rating contents any time I try to do a simple update / insert to the Ratings property. What I want is an indexed collection but not using the database generated ID (which is in the six digit range right now). Any thoughts on how I could get a zero-based indexed collection (so I can go entity.Ratings[0].Name = "foo") which would allow me to modify the collection without deleting/reinserting it all when persisting?

    Read the article

  • iPhone: CALayer + rotate in 3D + antialias?

    - by Colin
    Hi all, An iPhone SDK question: I'm drawing a UIImageView on the screen. I've rotated it in 3D and provided a bit of perspective, so the image looks like it's pointing into the screen at an angle. That all works fine. Now the problem is the edges of the resulting picture don't seem to be antialiased at all. Anybody know how to make it so? Essentially, I'm implementing my own version of CoverFlow (yeah yeah, design patent blah blah) using quartz 3d transformations to do everything. It works fine, except that each cover isn't antialiased, and Apples version is. I've tried messing around with the edgeAntialisingMask of the CALayer, but that didn't help - the defaults are that every edge should be antialiased... thanks!

    Read the article

  • Problem with the way the Ajax Control Toolkit TabContainer sets the default submit button

    - by Colin
    We have an Ajax Control Toolkit TabContainer containing some textboxes for doing a search. When you keypress inside one of the textboxes, the TabContainer sets the default button to be the button immediately following the tab control. This is fine because that's the search button. The problem occurs after the button is clicked and results returned. Now there is no default button, and keypress does nothing. Any suggestions?

    Read the article

  • How do I solve an AntiForgeryToken exception that occurs after an iisreset in my ASP.Net MVC app?

    - by Colin Newell
    I’m having problems with the AntiForgeryToken in ASP.Net MVC. If I do an iisreset on my web server and a user continues with their session they get bounced to a login page. Not terrible but then the AntiForgery token blows up and the only way to get going again is to blow away the cookie on the browser. With the beta version of version 1 it used to go wrong when reading the cookie back in for me so I used to scrub it before asking for a validation token but that was fixed when it was released. For now I think I’ll roll back to my code that fixed the beta problem but I can’t help but think I’m missing something. Is there a simpler solution, heck should I just drop their helper and create a new one from scratch? I get the feeling that a lot of the problem is the fact that it’s tied so deeply into the old ASP.Net pipeline and is trying to kludge it into doing something it wasn’t really designed to do. I had a look in the source code for the ASP.Net MVC 2 RC and it doesn't look like the code has changed much so while I haven't tried it, I don't think there are any answers there. Here is the relevant part of the stack trace of the exception. Edit: I just realised I didn't mention that this is just trying to insert the token on the GET request. This isn't the validation that occurs when you do a POST kicking off. System.Web.Mvc.HttpAntiForgeryException: A required anti-forgery token was not supplied or was invalid. ---> System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. ---> System.Web.UI.ViewStateException: Invalid viewstate. Client IP: 127.0.0.1 Port: 4991 User-Agent: scrubbed ViewState: scrubbed Referer: blah Path: /oursite/Account/Login ---> System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast) at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) at System.Security.Cryptography.CryptoStream.FlushFinalBlock() at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) --- End of inner exception stack trace --- --- End of inner exception stack trace --- at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) at System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) at System.Web.Mvc.AntiForgeryDataSerializer.Deserialize(String serializedToken) --- End of inner exception stack trace --- at System.Web.Mvc.AntiForgeryDataSerializer.Deserialize(String serializedToken) at System.Web.Mvc.HtmlHelper.GetAntiForgeryTokenAndSetCookie(String salt, String domain, String path) at System.Web.Mvc.HtmlHelper.AntiForgeryToken(String salt, String domain, String path)

    Read the article

  • Android app in eclipse

    - by Colin
    Hello everybody, i've searched for days but cant find an answer, perhaps you guys can help. I'm creating an android app in eclipse, it all works just one thing is bugging me. this is my main.java: package com.test; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Toast; public class Main extends Activity implements OnClickListener { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // Add Click listeners for all buttons View firstButton = findViewById(R.id.btn_rassen); firstButton.setOnClickListener(this); View secondButton = findViewById(R.id.button2); secondButton.setOnClickListener(this); } // Process the button click events @Override public void onClick(View v) { switch(v.getId()){ case R.id.btn_rassen: Intent j = new Intent(this, Webscreen.class); j.putExtra(com.test.Webscreen.URL, "http://www.google.com/"); startActivity(j); break; case R.id.button2: Intent k = new Intent(this, Webscreen.class); k.putExtra(com.test.Webscreen.URL, "http://notworkingurltotest.com"); startActivity(k); break; } } } now when it calls the webview.java the page called shows up but not the buttons i created in the layout xml page. does anybody have any idea why this is? your help is much appreciated! ohw this is my webscreen.java package com.test; import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class Webscreen extends Activity { public static final String URL = ""; private static final String TAG = "WebscreenClass"; private WebView webview; private ProgressDialog progressDialog; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.webscreen); this.getIntent().getExtras(); this.webview = (WebView) findViewById(R.string.webview); String turl = getIntent().getStringExtra(URL); Log.i(TAG, " URL = "+turl); WebView webview = new WebView(this); setContentView(webview); final Activity activity = this; webview.setWebViewClient(new WebViewClient() { public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } public void onLoadResource (WebView view, String url) { if (progressDialog == null) { progressDialog = new ProgressDialog(activity); progressDialog.setMessage("Bezig met laden..."); progressDialog.show(); } } public void onPageFinished(WebView view, String url) { if (progressDialog.isShowing()) { progressDialog.dismiss(); progressDialog = null; } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Intent myIntent = new Intent(); myIntent.setClassName("com.test", "com.test.Main"); startActivity(myIntent); Toast.makeText(activity, "Laden van onderdeel mislukt, probeer het later nog eens! ", Toast.LENGTH_LONG).show(); progressDialog.show(); } }); webview.loadUrl(turl); } } webscreen.xml layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <!-- <1> --> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/url" android:layout_height="wrap_content" android:layout_width="wrap_content" android:lines="1" android:layout_weight="1.0" android:hint="http://" android:visibility="visible" /> <Button android:id="@+id/go_button" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="go_button" /> </LinearLayout> <!-- <2> --> <WebView android:id="@string/webview" android:layout_width="fill_parent" android:layout_height="0dip" /> </LinearLayout>

    Read the article

  • CSS width fills out in IE8 Compatibility mode, works as it should in normal mode

    - by Colin
    I am trying to create a border around an image on the page, and the border works fine in IE8 Normal mode, but fills to 100% of the outer div in IE8 compatibility mode, my css is the following: .page-layout .page-header .page-image { float:left; vertical-align:top; width:170px; } .page-layout .page-header .page-image div, .page-layout .page-header .page-image img { float:left; } .page-image-imgtop { background-image:url('/Style Library/images/pagecontent-image-top-bg.png'); background-repeat:repeat-x; height:6px; float:left; clear:both; width:100%; } .page-image-imgleft { background-image:url('/Style Library/images/pagecontent-image-bg-left.png'); background-repeat:repeat-y; float:left; text-align:right; clear:both; } .page-image-imgright { margin-left:7px; padding-right:8px; background-image:url('/Style Library/images/pagecontent-image-bg-right.png'); background-repeat:repeat-y; background-position:top right; float:left; clear:both; } .page-image-imgbottom { background-image:url('/Style Library/images/pagecontent-image-bottom-bg.png'); background-repeat:repeat-x; height:6px; float:left; clear:both; width:100%; } And the following HTML: <div class="page-image"> <div class="page-image-imgleft"> <div class="page-image-imgtop"> <img src="/Style Library/images/pagecontent-image-top-left.png" style="float:left;" /> <img src="/Style Library/images/pagecontent-image-top-right.png" style="float:right" /> </div> <div class="page-image-imgright"> <img src="MAINIMAGE.jpg" style="border-width:0px;text-align:top;" /> </div> <div class="page-image-imgbottom"> <img src="/Style Library/images/pagecontent-image-bottom-left.png" style="float:left;" /> <img src="/Style Library/images/pagecontent-image-bottom-right.png" style="float:right" /> </div> </div> </div>

    Read the article

  • Setup.exe files downloading without cab files over poor connections

    - by Colin
    We have customers who are trying to download a setup.exe file over mobile connections that appear to be very slow. They have reported that when they click on the downloaded setup.exe, the install wizard starts up, but part way through the wizard they get an error message indicating that a cab file is corrupt or missing. They couriered a problem tablet to us, and we downloaded the file without a problem but I could replicate the problem by using https to download the file (https is normally used to access the rest of the site, although it is not necessary for the download). When I did this the downloaded file was 2.8MB. It should be 8MB. I don't think that https is the root cause of the problem because I can see the download link in the browser history using http, so I know the customer tried to download using http. I think that the issue is that the poor connection is preventing a complete download, but the browser is acting as if it is complete. Is there a way to ensure the file is downloaded fully, or not at all? Why does the browser not indicate that the download is incomplete?

    Read the article

  • How to refactor use of the general Exception?

    - by Colin
    Our code catches the general exception everywhere. Usually it writes the error to a log table in the database and shows a MessageBox to the user to say that the operation requested failed. If there is database interaction, the transaction is rolled back. I have introduced a business logic layer and a data access layer to unravel some of the logic. In the data access layer, I have chosen not to catch anything and I also throw ArgumentNullExceptions and ArgumentOutOfRangeExceptions so that the message passed up the stack does not come straight from the database. In the business logic layer I put a try catch. In the catch I rollback the transaction, do the logging and rethrow. In the presentation layer there is another try catch that displays a MessageBox. I am now thinking about catching a DataException and an ArgumentException instead of an Exception where I know the code only accesses a database. Where the code accesses a web service, then I thought I would create my own "WebServiceException", which would be created in the data access layer whenever an HttpException, WebException or SoapException is thrown. So now, generally I will be catching 2 or 3 exceptions where currently I catch just the general Exception, and I think that seems OK to me. Does anyone wrap exceptions up again to carry the message up to the presentation layer? I think I should probably add a try catch to Main() that catches Exception, attempts to log it, displays an "Application has encountered an error" message and exits the application. So, my question is, does anyone see any holes in my plan? Are there any obvious exceptions that I should be catching or do these ones pretty much cover it (other than file access - I think there is only 1 place where we read-write to a config file).

    Read the article

  • XSL unique values per node per position

    - by Nathan Colin
    this get ever more complicated :) now i face another issue in last question we managed to take unique values from only one parent node now with: <?xml version="1.0" encoding="ISO-8859-1"?> <roots> <root> <name>first</name> <item> <something>A</something> <something>A</something> </item> <item> <something>B</something> <something>A</something> </item> <item> <something>C</something> <something>P</something> </item> <item> <something>A</something> <something>L</something> </item> <item> <something>A</something> <something>A</something> </item> <item> <something>B</something> <something>A</something> </item> <item> <something>D</something> <something>A</something> </item> </root> <root> <name>second</name> <item> <something>E</something> <something>A</something> </item> <item> <something>B</something> <something>A</something> </item> <item> <something>F</something> <something>A</something> </item> <item> <something>A</something> <something>A</something> </item> <item> <something>A</something> <something>A</something> </item> <item> <something>B</something> <something>H</something> </item> <item> <something>D</something> <something>G</something> </item> </root> </roots> now i need to get the unique values depending only from one node before but just from the elements on the second position <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" method="text"/> <xsl:key name="item-by-value" match="something" use="concat(normalize-space(.), ' ', generate-id(./ancestor::root))"/> <xsl:key name="rootkey" match="root" use="name"/> <xsl:template match="/"> <xsl:for-each select="key('rootkey','first')"> <xsl:for-each select="item/something[1]"> <xsl:sort /> <xsl:if test="generate-id() = generate-id(key('item-by-value', concat(normalize-space(.), ' ', generate-id(./ancestor::root))))"> <xsl:value-of select="."/> </xsl:if> </xsl:for-each> <xsl:text>_________</xsl:text> <xsl:for-each select="item/something[2]"> <xsl:sort /> <xsl:if test="generate-id() = generate-id(key('item-by-value', concat(normalize-space(.), ' ', generate-id(./ancestor::root))))"> <xsl:value-of select="."/> </xsl:if> </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> with this XSL i get ABCD__LP where the result i need is ABCD__ALP any ideas?

    Read the article

  • Incoming SMS - redirect to server via HTTP

    - by Colin Kinsella
    Hi I am looking for a windows application which will receive SMS via a GSM modem. The application needs to forward the 'raw' PDU via HTTP Post to a page on our server. The app needs to deal receive a confirmation reciept from our server and deal with undelivered PDU strings. I would be happy for someone to quote for building this straightforward application. Thanks CKxion

    Read the article

  • Is JSON.stringify() reliable for serializing JSON objects?

    - by Colin
    I need to send full objects from Javascript to PHP. It seemed pretty obvious to do JSON.stringify() and then json_decode() on the PHP end, but will this allow for strings with ":" and ","? Do I need to run an escape() function on big user input strings that may cause an issue? What would that escape function be? I don't think escape works for my purposes. Are there any downsides to JSON.stringify() I need to know about? Thanks

    Read the article

  • Finding parents where child collection does not contain an item with a specific property value

    - by Colin Bowern
    I am trying to get a list of parents where the child collection does not contain an item of a specific type. The LINQ equivalent would be something like: dataset.Where(x => x.Items.FirstOrDefault(y => y.Type.Code == "ABC") == null) The object model is Parent Child (Items) Type Code If Parent is my aggregate root, how would I model this in NHibernate criteria/query? Here's my first attempt: var results = session.CreateCriteria<Parent>() .CreateCriteria("Items") .CreateCriteria("Type") .Add(Restrictions.Not(Restrictions.Eq("Code", "ABC"))) .SetResultTransformer(Transformers.DistinctRootEntity) .List<Parent>(); This doesn't seem to return the right entities - it just returns them all.

    Read the article

  • Help importing .pdb file into Maple

    - by Colin
    I realy know nothing about Maple, so any help would be nice. I am attempting to import a .pdb file into Maple, as part of converting some Mathematica code to Maple. I need something that that can accomplish something equivalent to the Import command in Mathematica. I have tried using readdata, ImportData and fopen with little success. If anyone has any suggestions, that would be of great help.

    Read the article

  • How to use parameter with LIKE in Sql Server Compact Edition

    - by Colin
    I'm trying to parameterise a search query that uses the LIKE keyword with a wildcard. The original sql has dynamic sql like this: "AND JOB_POSTCODE LIKE '" + isPostCode + "%' " So I've tried this instead, but I get a FormatException: "AND JOB_POSTCODE LIKE @postcode + '%' " Edit: I guess the FormatException isn't going to be coming from Sql Server CE, so as requested, here is how I set the parameter in my C# code. The parameter is set in code like this: command.Parameters.Add("@postcode", SqlDbType.NVarChar).Value = isPostCode; I also tried: "AND JOB_POSTCODE LIKE @postcode" with command.Parameters.Add("@postcode", SqlDbType.NVarChar).Value = isPostCode + "%"; but that doesn't return any results. Can anyone advise how to use parameters in this search sql?

    Read the article

  • Duplicate Items Using Join in NHibernate Map

    - by Colin Bowern
    I am trying to retrieve the individual detail rows without having to create an object for the parent. I have a map which joins a parent table with the detail to achieve this: Table("UdfTemplate"); Id(x => x.Id, "Template_Id"); Map(x => x.FieldCode, "Field_Code"); Map(x => x.ClientId, "Client_Id"); Join("UdfFields", join => { join.KeyColumn("Template_Id"); join.Map(x => x.Name, "COLUMN_NAME"); join.Map(x => x.Label, "DISPLAY_NAME"); join.Map(x => x.IsRequired, "MANDATORY_FLAG") .CustomType<YesNoType>(); join.Map(x => x.MaxLength, "DATA_LENGTH"); join.Map(x => x.Scale, "DATA_SCALE"); join.Map(x => x.Precision, "DATA_PRECISION"); join.Map(x => x.MinValue, "MIN_VALUE"); join.Map(x => x.MaxValue, "MAX_VALUE"); }); When I run the query in NH using: Session.CreateCriteria(typeof(UserDefinedField)) .Add(Restrictions.Eq("FieldCode", code)).List<UserDefinedField>(); I get back the first row three times as opposed to the three individual rows it should return. Looking at the SQL trace in NH Profiler the query appears to be correct. The problem feels like it is in the mapping but I am unsure how to troubleshoot that process. I am about to turn on logging to see what I can find but I thought I would post here in case someone with experience mapping joins knows where I am going wrong.

    Read the article

  • Alternatives to javascript function-based iteration (e.g. jQuery.each())

    - by Colin
    I've been watching Google Tech Talks' Speed Up Your Javascript and in talking about loops, the speaker mentions to stay away from function-based iterations such as jQuery.each() (among others, at about 24:05 in the video). He briefly explains why to avoid them which makes sense, but admittedly I don't quite understand what an alternative would be. Say, in the case I want to iterate through a column of table cells and use the value to manipulate the adjacent cell's value (just a quick example). Can anyone explain and give an example of an alternative to function-based iteration?

    Read the article

  • Databinding a StructuredPropertyEditor specific to type and target in Spring(Grails) - Selective app

    - by Colin Harrington
    Using Grails 1.2.2, I'm working on binding a structured property (CC expiration Date) to a java.util.Date but only for specific Domain and Commands objects. I've found the StructuredPropertyEditor interface, but the only way that I've found to register it is to use the PropertyEditorRegistrar and register the editor for the java.util.Date class (much like this example) I don't want all of my dates to use my custom StructuredPropertyEditor. How do I apply the StructuredPropertyEditor selectively to specific targets like certain Command & Domain Classes?

    Read the article

  • adding multiple <asp:Hyperlink>s into a repeater

    - by Colin Pickard
    I have a repeater control, and I want to put an unknown number of <asp:Hyperlink>s into the template, for example if you start with this: <asp:Repeater runat="server" ID="PetsRepeater"> <ItemTemplate> <%#DataBinder.Eval(Container.DataItem, "Owner")%> <%#this.ListPets(Container.DataItem)%> </ItemTemplate> </asp:Repeater> and in code behind: public partial class test1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { PetOwner p = new PetOwner() { Owner = "Jimmy", PetNames = new List<String>() { "Nemo", "Dory" } }; List<PetOwner> PetOwners = new List<PetOwner>() { p }; PetsRepeater.DataSource = PetOwners; PetsRepeater.DataBind(); } } protected String ListPets(Object PetOwner) { StringBuilder sb = new StringBuilder(); foreach (String Name in ((PetOwner)PetOwner).PetNames) { if (sb.Length > 0) sb.Append(", "); sb.Append(Name); } return sb.ToString(); } } class PetOwner { public String Owner; public List<String> PetNames; } Now suppose instead of having the string "Nemo, Dory" in my repeater, I want something like this: <asp:HyperLink runat=server Text="Nemo" NavigateUrl="Pet.aspx?Name=Nemo" />, <asp:HyperLink runat=server Text="Dory" NavigateUrl="Pet.aspx?Name=Dory" /> How can I do that? I tried putting a foreach inline in the aspx page, but I get the error Invalid expression term 'foreach'.

    Read the article

  • How to download .txt file from a url?

    - by Colin Roe
    I produced a text file and is saved to a location in the project folder. How do I redirect them to the url that contains that text file, so they can download the text file. CreateCSVFile creates the csv file to a file path based on a datatable. Calling: string pth = ("C:\\Work\\PG\\AI Handheld Website\\AI Handheld Website\\Reports\\Files\\report.txt"); CreateCSVFile(data, pth); And the function: public void CreateCSVFile(DataTable dt, string strFilePath) { StreamWriter sw = new StreamWriter(strFilePath, false); int iColCount = dt.Columns.Count; for (int i = 0; i < iColCount; i++) { sw.Write(dt.Columns[i]); if (i < iColCount - 1) { sw.Write(","); } } sw.Write(sw.NewLine); // Now write all the rows. foreach (DataRow dr in dt.Rows) { for (int i = 0; i < iColCount; i++) { if (!Convert.IsDBNull(dr[i])) { sw.Write(dr[i].ToString()); } if (i < iColCount - 1) { sw.Write(","); } } sw.Write(sw.NewLine); } sw.Close(); Response.WriteFile(strFilePath); FileInfo fileInfo = new FileInfo(strFilePath); if (fileInfo.Exists) { //Response.Clear(); //Response.AddHeader("Content-Disposition", "attachment; filename=" + fileInfo.Name); //Response.AddHeader("Content-Length", fileInfo.Length.ToString()); //Response.ContentType = "application/octet-stream"; //Response.Flush(); //Response.TransmitFile(fileInfo.FullName); } }

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >