<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tag 'c#'</title><link>http://forums.asp.net/search/SearchResults.aspx?q=&amp;tag=c%23&amp;orTags=0&amp;o=DateDescending</link><description>Search results matching tag 'c#'</description><dc:language>en-US</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>How a browser communicates with an Activex object?</title><link>http://forums.asp.net/thread/3578534.aspx</link><pubDate>Tue, 22 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3578534</guid><dc:creator>Dynamic2008</dc:creator><description>&lt;p&gt;&lt;b&gt;Background:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;I have registered my Activex component (e.g. xxx.dll assembly) into the registry using regasm tool.
&lt;/p&gt;&lt;div&gt;&lt;/div&gt;
&lt;div&gt;I have placed an object element inside my test.aspx page:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;pre name="code" class="c-sharp"&gt;&amp;lt;OBJECT id=&amp;quot;CtiConnector&amp;quot; name=&amp;quot;CtiConnector&amp;quot; classid=&amp;quot;clsid:67100952-F2F9-4fe8-921A-xxxxxxxxx&amp;quot;&amp;gt;&amp;lt;/OBJECT&amp;gt;    &lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;My CtiConnector object has a method which returns a value e.g. int Add(int a, int b) {...}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I can call this method using javascript as following:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;var result = CtiConnect.Add(1, 2);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Question:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am just wondering when Add method is called how this method is executed internally?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;where is the actual object? on the page itself? How the method is executed? Does it serialize the Add call to something and then deserializes the result?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I want to verify with reasoning which one has a better performance and why?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. Adding a javascript function which does the Add functionality on the page&lt;/div&gt;&lt;div&gt;2. Or adding the Add function inside my Activex object and implement it with C#&lt;/div&gt;&lt;p&gt;&lt;/p&gt;</description></item><item><title>urgent help needed for building a scalable storage solution for a web application</title><link>http://forums.asp.net/thread/3579122.aspx</link><pubDate>Tue, 22 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3579122</guid><dc:creator>opusleo</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;We currently are running a website where users can upload HD music and images. Originally i started off with 2TB of storage per drive and had a system where i could just add drives, but soon realised that at this rate I would like to have networked drives and would like to access the volume from different machines (Load Balanced). so for storage instead of having drives i switched to networked access and i can scale by just indicating which is the active volume and by volume i have network drives so for example let us say currently i have two volumes&lt;/p&gt;&lt;p&gt;\\system1\d\&lt;/p&gt;&lt;p&gt;\\system2\d\&lt;/p&gt;&lt;p&gt;So I will use which ever is currently active and this helped me scale for different machines also. But after switching from local drives to network drives. I continously run it an issue with &amp;quot;The process cannot access the file xxx because it is being used by another process&amp;quot; exception this is even though i call close and dispose and release all the handles(I am pretty sure i release the handles). I have a few questions&lt;/p&gt;&lt;p&gt;1) Most important is why is this file locking happenign and for the immediate is there an immediate fix that can be done.(URGENT PRODUCTION ISSUE!!!!!)&lt;/p&gt;&lt;p&gt;2) is this mode of access slow ? is there a better way to design drive scalability for over 10 to 20 terrabytes of data? &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I am running IIS6, .net 2.0, VS 2008&lt;br /&gt;&lt;/p&gt;</description></item><item><title>DD using L2S - Search tool</title><link>http://forums.asp.net/thread/3578943.aspx</link><pubDate>Tue, 22 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3578943</guid><dc:creator>Kevin Alkema</dc:creator><description>&lt;p&gt;Does&amp;nbsp;anyone have an&amp;nbsp;example of how to implement a search function. I have an application that I need to have a Search Text box on the master page. I&amp;#39;ve tried several ways to get this done but&amp;nbsp;they&amp;nbsp;have not worked out. I&amp;#39;ve tried using the GridDataSource.Where (which seemed to get me closest)&amp;nbsp;but then you can&amp;#39;t use the AutoGenerateWhereClause (which I then looped through and added&amp;nbsp;manually)&amp;nbsp;and you have to do a databind&amp;nbsp;which causes issues with paging, etc. &lt;/p&gt;</description></item><item><title>Receiving messages in asp.net 2.0</title><link>http://forums.asp.net/thread/3576594.aspx</link><pubDate>Mon, 21 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3576594</guid><dc:creator>Liyakath</dc:creator><description>&lt;p&gt;receive messages in asp.net 2.o.&lt;/p&gt;
&lt;p&gt;users can send and recieve messages in asp.net 2.0 like Orkut, Facebook&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Receiving messages in asp.net 2.0</title><link>http://forums.asp.net/thread/3576795.aspx</link><pubDate>Mon, 21 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3576795</guid><dc:creator>Liyakath</dc:creator><description>&lt;p&gt;we send messages using smtp server that we configure in web.config&lt;/p&gt;
&lt;p&gt;how to receive that message in our application&amp;nbsp;&lt;/p&gt;</description></item><item><title>sendind and receiving messages in asp.net</title><link>http://forums.asp.net/thread/3576776.aspx</link><pubDate>Mon, 21 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3576776</guid><dc:creator>Liyakath</dc:creator><description>&lt;p&gt;we use smtp server to send messages in asp.net applcation&lt;/p&gt;
&lt;p&gt;but how to receive that messages in our asp.net application.&lt;/p&gt;</description></item><item><title>C# File Upload works...sometimes!</title><link>http://forums.asp.net/thread/3577075.aspx</link><pubDate>Mon, 21 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3577075</guid><dc:creator>BrianFan</dc:creator><description>&lt;pre class="c-sharp" name="code"&gt;I have a file upload feature in one of aspx pages which allows users to upload multiple files at once.  It works perfectly when I am debugging locally, but when&lt;/pre&gt;&lt;pre class="c-sharp" name="code"&gt;my users hit the website, nothing will upload, only a randon PDF file here and there.  The size of the files being uploaded are less than 800KB.  Below is the code.&lt;/pre&gt;&lt;pre class="c-sharp" name="code"&gt;Here is the ASP code:&lt;/pre&gt;&lt;pre class="c-sharp" name="code"&gt;&amp;lt;div style=&amp;quot;text-align:left; margin-top:10px; border:inset 3px; width:750px;&amp;quot;&amp;gt;
&amp;lt;h3 style=&amp;quot;color:White; text-decoration:underline;&amp;quot;&amp;gt;Have a Photo of the Item?&amp;lt;/h3&amp;gt;
&amp;lt;input id=&amp;quot;FindFile&amp;quot; type=&amp;quot;file&amp;quot; size=&amp;quot;50&amp;quot; runat=&amp;quot;server&amp;quot; name=&amp;quot;FindFile&amp;quot; /&amp;gt;&amp;nbsp;&amp;nbsp;&amp;lt;asp:button 
        id=&amp;quot;AddFile&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Add&amp;quot; SkinID=&amp;quot;LoginButton&amp;quot; 
        onclick=&amp;quot;AddFile_Click&amp;quot;  /&amp;gt;
    &amp;nbsp;
&amp;lt;asp:button id=&amp;quot;RemvFile&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Remove&amp;quot; SkinID=&amp;quot;LoginButton&amp;quot; 
        onclick=&amp;quot;RemvFile_Click&amp;quot; /&amp;gt;
    &amp;lt;br /&amp;gt;
    &amp;lt;asp:ListBox style=&amp;quot;margin-left:50px;&amp;quot; ID=&amp;quot;ListBox1&amp;quot; runat=&amp;quot;server&amp;quot; Height=&amp;quot;100px&amp;quot; Width=&amp;quot;500px&amp;quot;&amp;gt;
    &amp;lt;/asp:ListBox&amp;gt;
 &amp;lt;/div&amp;gt;
&amp;lt;br /&amp;gt;
&amp;lt;div style=&amp;quot;margin-left:50px;&amp;quot;&amp;gt;
&amp;lt;asp:Panel ID=&amp;quot;pnlButtons&amp;quot; Visible=&amp;quot;false&amp;quot; runat=&amp;quot;server&amp;quot; Width=&amp;quot;60%&amp;quot;&amp;gt;
&amp;lt;table cellspacing=&amp;quot;3px&amp;quot;&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;asp:Button ID=&amp;quot;btnSave&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Save&amp;quot; SkinID=&amp;quot;LoginButton&amp;quot; 
        onclick=&amp;quot;btnSave_Click&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;asp:Button ID=&amp;quot;btnClearAll&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Clear All&amp;quot; 
        SkinID=&amp;quot;LoginButton&amp;quot; onclick=&amp;quot;btnClearAll_Click&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;asp:Button ID=&amp;quot;btnCancel&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Cancel&amp;quot; SkinID=&amp;quot;LoginButton&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;asp:Button ID=&amp;quot;btnDelete&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Delete&amp;quot; SkinID=&amp;quot;LoginButton&amp;quot; 
        onclick=&amp;quot;btnDelete_Click&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;/asp:Panel&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;Here is the C# code:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;        foreach (System.Web.UI.HtmlControls.HtmlInputFile HIF in hif)
        {
            try
            {
                byte[] imageSize = new byte[HIF.PostedFile.ContentLength];
                HttpPostedFile uploadedFile = HIF.PostedFile;

                string strFileName = HIF.PostedFile.FileName;
                string[] fileParts = strFileName.Split(&amp;#39;\\&amp;#39;);
                int numOfIndex = fileParts.Length - 1;
                string fileName = fileParts[numOfIndex].ToString();
                string[] fileExt = fileName.Split(&amp;#39;.&amp;#39;);
                string extension = fileExt[1].ToString();
                string contentType = HIF.PostedFile.ContentType;
                uploadedFile.InputStream.Read(imageSize, 0, (int)HIF.PostedFile.ContentLength);

                if (fileTypes.Contains(extension))
                {
                    objGetExistingFileCount = new Part_Tracker();
                    objGetExistingFileCount.GetCountOfExistingFileName(fileName, Convert.ToInt32(lblChangeReqID.Text));

                    if (objGetExistingFileCount.ExistingFileCountByChangeReqID == 0)
                    {
                        objUploadFile = new Part_Tracker();
                        objUploadFile.UploadFileForRFC(lblChangeReqID.Text, fileName, contentType, imageSize);
                    }
                    else
                    {
                        objUploadFile = new Part_Tracker();
                        objUploadFile.UploadFileForRFC(lblChangeReqID.Text, &amp;quot;+&amp;quot; + fileName, contentType, imageSize);
                    }
                }
            }
            catch (Exception err)
            { }
        }
        hif.Clear();
        ListBox1.Items.Clear();
&lt;/pre&gt;
&lt;p&gt;And here is the C# from my class library for when objFileUpload.UploadFileForRFC gets called:&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;public bool UploadFileForRFC(string ChangeReqID, string FileName, string ContentType, byte[] imageSize)
        {
            _wasSuccess = true;
            SqlConnection objConn = null;
            try
            {
                objConn = new SqlConnection(ConfigurationManager.ConnectionStrings[&amp;quot;LocalSqlServer&amp;quot;].ConnectionString);
                objConn.Open();
                SqlCommand objCmd = new SqlCommand(&amp;quot;mrap_Upload_RFC_PartTracker_Files&amp;quot;, objConn);
                objCmd.CommandType = CommandType.StoredProcedure;

                SqlParameter paramReturnValue = new SqlParameter();
                paramReturnValue.ParameterName = &amp;quot;@FileCount&amp;quot;;
                paramReturnValue.SqlDbType = SqlDbType.Int;
                paramReturnValue.Direction = ParameterDirection.ReturnValue;

                objCmd.Parameters.Add(new SqlParameter(&amp;quot;@ChangeReqID&amp;quot;, ChangeReqID));
                objCmd.Parameters.Add(new SqlParameter(&amp;quot;@FileName&amp;quot;, FileName));
                objCmd.Parameters.Add(new SqlParameter(&amp;quot;@File&amp;quot;, imageSize));
                objCmd.Parameters.Add(new SqlParameter(&amp;quot;@ContentType&amp;quot;, ContentType));
                objCmd.Parameters.Add(paramReturnValue);
                objCmd.ExecuteNonQuery();

                FileCount = Convert.ToInt32(objCmd.Parameters[&amp;quot;@FileCount&amp;quot;].Value);
            }
            catch (Exception e) { _wasSuccess = false; }
            finally
            {
                if (objConn != null)
                {
                    objConn.Close();
                }
            }

            return _wasSuccess;
        }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;I&amp;#39;m not sure why this would work locally and not when I publish it on the server.&amp;nbsp; It&amp;#39;s an important part of the application, so I really appreciate everyone&amp;#39;s help in figuring it out.&amp;nbsp; The server is .NET 3.5, Server 2003, and all clients are Vista Enterprise.&lt;/p&gt;
&lt;p&gt;If anyone has a file uoload that does multiple files at once I would be more than happy to replace this code with something that works consistently.&amp;nbsp; Like I said, it works with one file (a PDF), but won&amp;#39;t take any other files, not even other PDF&amp;#39;s.&amp;nbsp; There is nothing restrictly the file size that I can see, so I really don&amp;#39;t understand what the problem is.&lt;/p&gt;
&lt;p&gt;Thanks for the help.&lt;/p&gt;
&lt;p&gt;Brian &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Update two table at a time using inner join</title><link>http://forums.asp.net/thread/3574061.aspx</link><pubDate>Sat, 19 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3574061</guid><dc:creator>faisale83</dc:creator><description>&lt;p&gt;Dear &lt;b&gt;Yousef_Jadallah,&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;see my query there is two table data have to change at a time where the condintion&amp;nbsp; &amp;quot;&lt;/b&gt;&lt;span&gt;&lt;span&gt;customer_ID&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&amp;quot; is equal &lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;ol start="1"&gt;
&lt;li&gt;&lt;i&gt;&lt;span&gt;&lt;span&gt;UPDATE&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;a&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;span&gt;&lt;span&gt;SET&lt;/span&gt;&lt;span&gt;&amp;nbsp;a.customer_Mobile1&amp;nbsp;=&amp;nbsp;@customer_Mobile1,&amp;nbsp;a.customer_Mobile2&amp;nbsp;=&amp;nbsp;@customer_Mobile2,&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;span&gt;&amp;nbsp;a.customer_Email&amp;nbsp;=&amp;nbsp;@customer_Email&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;span&gt;&lt;span&gt;from&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;span&gt;&amp;nbsp;Customers&amp;nbsp;&amp;nbsp;a&amp;nbsp;&lt;span&gt;INNER&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;JOIN&lt;/span&gt;&lt;span&gt;&amp;nbsp;Cusomers_Details&amp;nbsp;&amp;nbsp;b&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;i&gt;&lt;span&gt;ON&lt;/span&gt;&lt;/i&gt;&lt;span&gt;&lt;i&gt;&amp;nbsp;a.customer_id&amp;nbsp;=&amp;nbsp;b.customer_ID&amp;nbsp;&amp;nbsp; &lt;/i&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>Re: Assign roles to user according to functionality</title><link>http://forums.asp.net/thread/3574102.aspx</link><pubDate>Sat, 19 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3574102</guid><dc:creator>faisale83</dc:creator><description>&lt;p&gt;use attributes&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Attributes are a new kind of declarative information. We can use
attributes to define both design-level information (such as help file,
URL for documentation) and run-time information (such as associating
XML field with class field). We can also create &amp;quot;self-describing&amp;quot;
components using attributes. &lt;/p&gt;&lt;p&gt;I think this link will help you&lt;/p&gt;&lt;p&gt;&lt;a title="http://msdn.microsoft.com/en-us/library/aa288454%28VS.71%29.aspx" href="http://msdn.microsoft.com/en-us/library/aa288454%28VS.71%29.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa288454%28VS.71%29.aspx&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Put data from .cs file to .aspx file</title><link>http://forums.asp.net/thread/3574528.aspx</link><pubDate>Sat, 19 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3574528</guid><dc:creator>nvleeuwen88</dc:creator><description>&lt;p&gt;Hi asp.net builders,&lt;/p&gt;&lt;p&gt;I&amp;#39;m new to asp.net and I am trying to learn it so I was making a web application which needed to get some data from the database and show it in the website.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;So I thought let&amp;#39;s make a database class to make it in the whole application a little bit easier to get data from the database. So I made a function called getRow which is getting one row from the database by the query.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;pre name="code" class="c-sharp"&gt; public DataSet getRow( String query, String table )
        {
            try
            {
                this.open();

                SqlDataAdapter da = new SqlDataAdapter(query, this.conn);
                //create dataset to insert data in it
                DataSet ds = new DataSet();
                da.Fill(ds, table);
                
                this.close();
            }
            catch(SqlException ex)
            {
                throw ex;
            }

            return ds;

        }&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;But I get every time a error under the word Dataset so I was looking on the internet but could not find it. I think it&amp;#39;s because I&amp;#39;m not have all the using &lt;/p&gt;&lt;p&gt;&lt;pre name="code" class="c-sharp"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Configuration;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;The type or namespace name &amp;#39;DataSet&amp;#39; could not be found (are you missing a using directive or an assembly reference?)&amp;nbsp;&amp;nbsp;&amp;nbsp; Almeerse\Almeerse\classes\database.cs &lt;/p&gt;&lt;p&gt;So maby someone can help me to fix this problem. And can someone tell me how I can show the data which I get from the database. Because in the .aspx file I need to show the data.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thnx&amp;#39;s for all the tips/advices.&lt;/p&gt;&lt;p&gt;Nick&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>