- Strength to Increase Rep
- +16
- Strength to Decrease Rep
- -4
- Upvotes Received
- 574
- Posts with Upvotes
- 467
- Upvoting Members
- 183
- Downvotes Received
- 128
- Posts with Downvotes
- 103
- Downvoting Members
- 18
Software Engineer
- Interests
- Software Development
- PC Specs
- vrooom!!11!
| |
Re: You could use generics and extensions for this: [code] public static void Shuffle<T>(this IList<T> list) { Random rng = new Random(); int n = list.Count; while (n > 1) { n--; int k = rng.Next(n + 1); T value = list[k]; list[k] = list[n]; list[n] = value; } } [/code] … | |
Re: The problem is both projects can't access one another. There is a compile order you can see (click the "Debug"/"Release" dropdown and select options at the bottom, its in there). It first compiles project A, then project B. But if it cannot compile Project A until Project B has been … | |
Re: Here is another approach. [code] Imports System.Data.SqlClient 'IF OBJECT_ID('PDF', 'U') IS NOT NULL DROP TABLE PDF 'CREATE TABLE PDF '( ' RecordId int identity(1000, 1) PRIMARY KEY, ' PDF varbinary(max) ') Public Class frmPDF Private Sub ButtonUpload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonUpload.Click Using conn As New … | |
Re: You didn't marshal all the strings: [code] using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; using System.Security; using System.Security.Principal; namespace daniweb { public class WindowsLoadUserProfile { /// /// The LogonUser function attempts to log a user on to the local computer. /// [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = … | |
Re: Very nice! You have brought a lot of code together :) | |
Re: It could likely be modified somewhere else in your store procedure that you did not post here. Also -- this is not a good idea: [code=sql] IF OBJECT_ID('tempdb..#Test', 'U') IS NOT NULL DROP TABLE #Test Create Table #Test ( PK varchar(5) UNIQUE, Value1 decimal(5,2) ) GO Insert Into #Test (PK, … | |
Re: Are you running your software on both ends of the connection? [URL="http://en.wikipedia.org/wiki/Media_Access_Control"]MAC addresses[/URL] are only "guaranteed valid" for [URL="http://en.wikipedia.org/wiki/OSI_model#Layer_2:_Data_Link_Layer"]layer 2[/URL] communications in a LAN. They do not traverse a router as you would think. That being said if it is your software running on both ends then you can use … | |
Re: Count them: da.UpdateCommand.CommandText = "update per010_ssk set " + " izin_tipi=?, " {1} + " hareket_tipi=?, " {2} + " izin_sure=? ," {3} + " kullanim_sure=?, " {4} + " baslama_tarih=?, " {5} + " bitis_tarih=?, " {6} + " hakedis_tarih=?, " {7} + " sua=? " {8} + " … | |
Re: I do the same thing in a number of my applications and there is no "right" or "wrong" answer in my opinion, but the way I chose doesn't seem to be popular to internet folks. What I do is have an "Install Wizard" run as a separate application and it … | |
Re: Page: [code] <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DownloadForm.aspx.cs" Inherits="daniweb.asp.DownloadForm" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" /> </div> </form> </body> </html> [/code] Code behind: [code=c#] using System; using System.Collections.Generic; using System.Linq; using … | |
Re: Here is an example. See if you can modify it to suit your needs: [code=sql] Select Count(*) As CustCnt, (Select Count(*) From Invoice Where Invoice.CustNumber = Customer.CustNumber) As InvCnt From Customer Group By Customer.CustNumber [/code] | |
Re: **G_Waddell**: Short answer: You are using the wrong build type. My guess: you are running on a 64-bit version of windows and have your compiler output settings to "Any CPU prefer 32-bit", or "x86". See configuration options for solution: ![build.png](/attachments/large/1/0128138fafc3c9f3a8bace197730f39e.png "align-center") Long answer: The problem is build output on your … | |
Re: Why not just validate on the postback and come back with an error message if it is <10 characters? I can't think of any website that enforces a minimum length validation browser side. | |
Re: Take a look at this thread: [url]http://www.daniweb.com/forums/thread247583.html[/url] [URL="http://www.daniweb.com/forums/member633074.html"]MeSampath[/URL] provided this code: [code] MySqlConnection mcon = null; MySqlCommand cmd = null; FileStream fsObj = null; BinaryReader binRdr = null; try { //converting image to bytes fsObj = File.OpenRead(pictureBox1.ImageLocation); byte[] imgContent = new byte[fsObj.Length]; binRdr = new BinaryReader(fsObj); imgContent = binRdr.ReadBytes((int)fsObj.Length); mcon … | |
Re: Try this: [code=c#] private void DoExcel() { const string Fname = @"C:\dotnetwin\daniweb\Book1.xlsx"; Microsoft.Office.Interop.Excel.ApplicationClass excel = null; Microsoft.Office.Interop.Excel.Workbook wb = null; Microsoft.Office.Interop.Excel.Worksheet ws = null; Microsoft.Office.Interop.Excel.Range rng = null; object missing = Type.Missing; //bool ReadOnly = false; //true or missing gives the same try { //Excel.Application is abstract class so I … | |
Re: I can't figure out how to preview this post or what Dani did with code tags. I'll let the mods sort that out. My thoughts: You have a few problems 1) You didn't post complete code 2) The 4th argument of File.Open() you have FileShare.Read. You need _exclusive_ file access … | |
Re: As far as I know you cannot save over a file that already exists. With Excel automation I always save the file to a temp file and overwrite the old file: [code=c#] private void DoExcel() { const string Fname = @"C:\dotnetwin\daniweb\Book1.xlsx"; Microsoft.Office.Interop.Excel.ApplicationClass excel = null; Microsoft.Office.Interop.Excel.Workbook wb = null; Microsoft.Office.Interop.Excel.Worksheet … | |
Re: It is a code file automatically generated by your designer to hold the form's layout information that was created using the Visual Studio IDE. Previous versions of Visual Studio stored all of the information contained in the .designer.cs file in the main code file but the split it out due … | |
Re: Sometimes malware installs itself and forces an outbound proxy so it can hijack connections. I would run antivirus and antimalware first. If that isn't the issue then post back and we'll go from there. | |
Re: You want to "embed" the excel application inside of the page? That isn't going to be easy... if its' even possible. | |
Re: I don't know the capabilities of the wrt54g but you could plug a hub in to the router and branch the traffic off to your machine and run a packet sniffer such as wireshark and monitor all network traffic. You would see IM, emails, etc in addition to websites. Before … | |
Re: [code=sql] Insert Into aTable (SomeString, SomeDateTime) Values ('abc', GetDate()) [/code] [code=sql] Update aTable Set SomeDateTime = GetDate() [/code] | |
Re: Is there any reason you're trying to build it from source rather than installing it from the package repository? [code=bash] sk:~# apt-cache search libpcap | grep ^libp libpcap-dev - Development library for libpcap (transitional package) libpcap-ruby1.8 - Ruby interface for the libpcap packet capture library libpcap0.7 - System interface for … | |
Re: Sign your assemblies and don't distribute your application. The .NET assemblies are in MSIL so they can always be decompiled. | |
Re: [quote] KeyboardHookProc() stopped getting called: [/quote] I cant be sure of this without you posting a sample application, but from the sound of it you are either closing the connection OR the connection variables is going out of scope and becomes breakfast for the garbage collector. [quote] Another problem was … | |
Re: What kind of barcode reader? You can use a [URL="http://www.waspbarcode.com/"]wasp barcode reader[/URL] to scan barcodes and it will send the barcode data over via ps2/usb. Or are you talking about OCR recognition of barcodes in image files? I use [URL="http://www.atalasoft.com/"]Atalasoft[/URL]'s barcode ocr library for image detection. They have a runtime … | |
Re: Just test the length. [code] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace daniweb { public partial class frmLoginScreen : Form { public frmLoginScreen() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBox1.Text)) { MessageBox.Show("You must enter a … | |
Here is a sample code snippet of logging in a user against a user table in an MSSQL database with password encryption. Scott Knake | |
Re: Also take a look at "mshtml". |