Jump to content
Xtreme .Net Talk

Fork501

Avatar/Signature
  • Posts

    41
  • Joined

  • Last visited

About Fork501

  • Birthday 01/29/1986

Personal Information

  • Occupation
    Senior Programmer (ASP.NET Web Development)
  • Visual Studio .NET Version
    Visual Studio 2005
  • .NET Preferred Language
    C#, Java, JavaScript

Fork501's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I might be misunderstanding what you're looking for, but have you tried using the Reflection classes? Here's a crash course from About: http://visualbasic.about.com/od/usingvbnet/a/proginfo.htm There's probably much better tutorials out there, so just do a search for Reflection. I hope this helps! ~Derek
  2. I'd like to try to help you out, but your post is a little confusing. Which version of Access are you using? When you say changing the column name, do you mean that you're changing the name of the colulmn on the Access Database and then going back to your code and changing it there, as well? How are you accessing the database? Do you have it set up with the Database Explorer, or are you just doing it all by hand code? Could you show some code of how you're calling information from your database? Is this a website, or a Windows form? Hopefully we can solve this, once and for all =) ~Derek
  3. Have you tried putting the results in an adapter and parsing it after the data set is closed? For example: protected void SQLFunction() { DataTable dt = new DataTable(); using (SqlConnection myConn = new SqlConnection(strConnect)) { string strSQL = "SELECT TOP 10000 * FROM [TableName]"; myConn.Open(); SqlCommand myCommand = new SqlCommand(strSQL, myConn); SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand); myAdapter.Fill(dt); myConn.Close(); } foreach (DataRow row in dt.Rows) { lblResults.Text += row[0].ToString() + "<br />"; } } With those code, I took 10,000 results and was able to display everything from the first column without a timeout. Of course, you'd need to adapt this to use the Stored Procedure that you want. In my database, I have 31 columns in the particular table I tried it on and this entire code executed in roughly 12 seconds. I hope this helps! ~Derek
  4. I hear you on that one! I'm glad I came across this post, though. Gives me a topic to blog about :D ~Derek
  5. I know this is a semi-old thread (sort of), but I wanted to answer it, so others aren't confused. <!-- #include file='~/imageswap.html' --> This line will include a file for you. Since there's a tilde (~) and the beginning, it will start at the root and go through the directory structure to your location. So this is looking for imageswap.html in the root of the website. <!--<asp:HyperLink ID="HyperLink10" runat="server" NavigateUrl="~/About/BrucesBrew.aspx"><asp:Image ID="WhatsBrewingPhoto" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingPhoto01.jpg" BorderWidth="0" /></asp:HyperLink> --> This line will process your ASP.NET object (in this case, two HyperLinks and an Image) but when it processes it, it will be placed in a comment block and be invisible to the visitor. Viewing the source of the page will still yield HTML code associated with this. <%--<asp:Image ID="WhatsBrewingLS" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingLeftSpacer.gif" BorderWidth="0" /><asp:ImageButton ID="BrewingPrevious" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingPrevious.gif" BorderWidth="0" /><asp:ImageButton ID="BrewingNext" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingNext.gif" BorderWidth="0" /><asp:Image ID="WhatsBrewingRS" runat="server" ImageUrl="~/Images/Common/Extras/WhatsBrewing/WhatsBrewingRightSpacer.gif" BorderWidth="0" /><br />--%> Finally, this line will COMPLETELY ignore any code. I don't even think it's processed on the server's end. Since HTML is client-side, ASP.NET objects are processed before being displayed, so <%-- --%> is to ASP.NET as <!-- --> is to HTML. I hope this helps! ~Derek
  6. Well I finally came up with a solution! =) In the constructor for my object, I added the following lines: SecurityPermission sp = new SecurityPermission(PermissionState.Unrestricted); sp.Assert(); I then signed my project with a strong name and increased the Assembly's trust with the .NET Framework 2.0 Configuration utility. I will make a quick note that I have two object files in my project, because I have 2 sections to this application. I made both of those objects derive from the same base class. I was attempting to have the code placed in constructor of the base class, but this was not working at all. Once I put the code in the constructor for the derived class, everything worked perfectly! Thanks anyways =) ~Derek
  7. Hi, all! I was wondering if anyone knows how to adjust the granted security zone for a .NET ActiveX control? I am currently working on a project that will allow me to list my user's tasks in Outlook, but am unable to run the control without giving the security zone it's part of unrestricted access. When I launch it locally, it is part of the Intranet zone. When I launch it for my users, it will be part of the Internet zone. Unfortunately, neither of these are desierable, as I need the MyComputer zone. I would honestly have no problems with launching this in the Intranet zone and setting each user up with the proper security, since anything launched under Intranet will be created by me, either way. I have tried putting the following line in the AssemblyInfo.cs file for the ActiveX control: [assembly: AllowPartiallyTrustedCallersAttribute] That doesn't do anything at all. I have even tried putting the following line at the top of my class declaration: [ZoneIdentityPermission(SecurityAction.Demand, Zone=SecurityZone.Intranet)] Unfortunately, the control won't even load when launched in a web page. I've hit a brick wall here and can't figure this out :confused: My only other option is to find the DLL file somewhere in the Internet Explorer cache and grant the assembly full access privilages, but I wouldn't even know WHERE to look for that and if it would allow itself to remain with the access, if I make any changes. Any help would be GREATLY appreciated! Thank you in advance! ~Derek
  8. There definitely is. I didn't know how you were trying to implement your code. I was just showing how I implemented it. Don't focus on that; I was just showing how I got the parameter in there. ~Derek
  9. From what I understand, you're trying to enable/disable a textbox, based on the condition of whether or not a radio button is selected. You shouldn't be doing anything with RadioButton1 to get this, you don't even really need to base your thread off of RadioButton1 if you can work around it. Here's a quick project I set up with alterations to your code: Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Timer1.Enabled = True End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim t As New Threading.Thread(New Threading.ParameterizedThreadStart(AddressOf SetEnabled)) t.Start(RadioButton1.Checked) End Sub Delegate Sub SetEnabledCallback(ByVal Enabled As Object) Private Sub SetEnabled(ByVal Enabled As Object) If Me.TextBox1.InvokeRequired Then Dim d As New SetEnabledCallback(AddressOf SetEnabled) Me.Invoke(d, New Object() {Enabled}) Else Me.TextBox1.Enabled = Enabled End If End Sub End Class As you can see, you should check the invocation of TextBox1 and send RadioButton1's value as the parameter. Now, if you didn't even want to send in the parameter, you could still access RadioButton1.Checked from the thread without any problems. You can read a value from a non-threaded object, but you can't assign a value to it. Hence why you can't enable/disable a textbox from a thread, but you could read what value is in it. I've also noticed that when dealing with parameterized threads, it doesn't like you to tell it what kind of object you're using in your parameter, just that it's Object. Maybe I'm doing something incorrectly, but this is the way I do it. You can also verify that the object is of type Boolean if you decide later on to redistribute it for other developers. Hope this helps! ~Derek
  10. I think that having a class with all the defined variables would be easier if you were to hand it off to another programmer, but it really depends on how your dictionary class works; I've never actually worked with a class based off of the dictionary before. As for XML Serialization VS Binary Serialization: InformIT suggests Binary is faster. (http://www.informit.com/articles/article.aspx?p=29457&seqNum=3) 15 Seconds did an actual test and said Binary Serialization was 1,000% faster and Binary Deserialization was 380% faster. (http://www.15seconds.com/issue/020903.htm) So you're going to definitely have your advantage from using your Binary. I had misunderstood what you meant in the original post, I thought you wanted to be able to view everything. The advantage of XML Serialization would be if you planned on handing over the saved file for someone else to work with. Binary Serialization is .NET-Based, I believe.. so your PHP developers and Java Buffs wouldn't be able to do anything with it. ~Derek
  11. [i hope I'm understanding correctly] Have you ever tried XML Serialization? When it creates the XML for you, it will leave out XML tags for Reference-Type objects if they are left null. The drawback is that any Value-Type objects will remain with some default value (ie: Int always uses 0). Hope this helps! ~Derek
  12. Well I sure feel funny :D I forgot to mark the control as being COM Visible. Solved my problem as soon as it was checked. Determination often times solves even the most complex of problems :p Thanks anyways! ~Derek
  13. Does anyone know if there's a security policy, which would disallow JavaScript from sending data to/from a .NET ActiveX control? I've found some tutorials online about ActiveX and they all seem to use the same basic format for using JavaScript with it: *Create an Interface in the ActiveX Control *Derive your object class from the Interface *Implement a String value *Use the Set method to grab the value sent *Tell JavaScript to set [ControlID].[stringName] as a value ex: MyControl.Msg = 'Hello' When I follow the same basic steps, I'm unable to send values to the control. I've even tried skipping the step of creating an interface and that didn't help at all. Due to security policies here at work, I can't actually add my own site as a trusted site, so I'm stuck =\ I'd test at home, but I don't like to admit defeat if I don't have to :p Thanks in advance! ~Derek
  14. I'm glad it worked :) I still find that to be a very strange issue. I've compiled websites dozens of times and have never received an error about CSS. ~Derek
  15. This looks like it may be an installation issue. I just threw that same code into an ASP.NET project and it compiled without any problems. VS shouldn't actually validate your CSS like that. Are you only trying to compile it, or did you also try to debug (F5 or CTRL+F5)? ~Derek
×
×
  • Create New...