Posts
 
Reputation
Joined
Last Seen
Ranked #27
Strength to Increase Rep
+16
Strength to Decrease Rep
-4
89% Quality Score
Upvotes Received
574
Posts with Upvotes
467
Upvoting Members
183
Downvotes Received
128
Posts with Downvotes
103
Downvoting Members
18
259 Commented Posts
~1.07M People Reached
About Me

Software Engineer

Interests
Software Development
PC Specs
vrooom!!11!
Favorite Tags

2,245 Posted Topics

Member Avatar for Duki
Member Avatar for zambetta

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] …

Member Avatar for adajames
0
1K
Member Avatar for Bhoot

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 …

Member Avatar for V._549
0
11K
Member Avatar for gianrocks

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 …

Member Avatar for Owais_4
0
3K
Member Avatar for Shaitan00

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 = …

Member Avatar for Pooja_20
0
6K
Member Avatar for DdoubleD
Member Avatar for progtick

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, …

Member Avatar for happygeek
0
648
Member Avatar for siddhesh123

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 …

Member Avatar for JamesCherrill
0
2K
Member Avatar for snakay

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} + " …

Member Avatar for Reverend Jim
0
6K
Member Avatar for metalla_nz

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 …

Member Avatar for Garr
0
315
Member Avatar for bincy_2050

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 …

Member Avatar for sai_10
0
10K
Member Avatar for q8_dreamy

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]

Member Avatar for Sirisha_2
0
1K
Member Avatar for G_Waddell

**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 …

Member Avatar for JOSheaIV
0
344
Member Avatar for santhanalakshmi

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.

Member Avatar for Sagar_7
0
3K
Member Avatar for Dmennite

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 …

Member Avatar for Ehab_1
0
2K
Member Avatar for yash777

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 …

Member Avatar for creiglee
0
4K
Member Avatar for iamahar

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 …

Member Avatar for ddanbe
0
164
Member Avatar for ddanbe

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 …

Member Avatar for HaiLuong
0
4K
Member Avatar for george_82

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 …

Member Avatar for asdfiuo
0
7K
Member Avatar for rastafarian

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.

Member Avatar for yomawm
0
6K
Member Avatar for anithasalavadi

You want to "embed" the excel application inside of the page? That isn't going to be easy... if its' even possible.

Member Avatar for Makara
0
5K
Member Avatar for derekn

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 …

Member Avatar for jasonkaven
0
1K
Member Avatar for Gaurav arora

[code=sql] Insert Into aTable (SomeString, SomeDateTime) Values ('abc', GetDate()) [/code] [code=sql] Update aTable Set SomeDateTime = GetDate() [/code]

Member Avatar for Timothy_3
0
213
Member Avatar for arunmagar

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 …

Member Avatar for Web Spider
0
1K
Member Avatar for VIeditorlover

Sign your assemblies and don't distribute your application. The .NET assemblies are in MSIL so they can always be decompiled.

Member Avatar for JOSheaIV
1
1K
Member Avatar for Bhoot

[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 …

Member Avatar for Jay Cox
0
228
Member Avatar for mansoorhacker

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 …

Member Avatar for brent-me
0
339
Member Avatar for facadie

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 …

Member Avatar for vadde
0
4K
Member Avatar for sknake

Here is a sample code snippet of logging in a user against a user table in an MSSQL database with password encryption. Scott Knake

Member Avatar for pritaeas
10
8K
Member Avatar for sivamoni
Member Avatar for yousafc#

You may also want to check out this post for many examples: [url]http://www.daniweb.com/web-development/aspnet/threads/209172/940891#post940891[/url]

Member Avatar for mostafarafi
1
5K
Member Avatar for coollife

The table: [code=sql] Create Table Picture ( ID int identity(1000, 1) PRIMARY KEY, Picture image ) [/code] Code behind: [code=csharp] using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.IO; namespace daniweb.web { public partial class PagePost : System.Web.UI.Page { …

Member Avatar for mostafarafi
0
2K
Member Avatar for frankvalentin

I don't understand the problem. File.AppendAllText() creates a file if it does not exist and appends the text (not a line). This code will append the text, create the file if needed, and display the output after each write. [code=c#] using System; using System.Diagnostics; using System.IO; using System.Windows.Forms; namespace daniweb …

Member Avatar for ddanbe
0
3K
Member Avatar for Ghost

Please start new threads for your questions. You probably have another thread created that is not running as a background thread which will stop your application from closing until the thread aborts. You probably need to review if this is this case, or upload your project demonstrating the behavior. Please …

Member Avatar for vasanthmc2
1
10K
Member Avatar for stevetaylor15

[code=csharp] private void button14_Click(object sender, EventArgs e) { FileInfo[] files = new DirectoryInfo(@"C:\").GetFiles(@"*.txt"); foreach (FileInfo file in files) { if (DateTime.UtcNow.Subtract(file.LastWriteTimeUtc).TotalDays >= 3) { Console.WriteLine(file.FullName + " needs to be copied"); } } } [/code]

Member Avatar for ddanbe
0
220
Member Avatar for mansi sharma

Get the Gridview's selected row handle or associated data row and call [icode].Delete()[/icode] on the DataRow then [icode].AcceptChanges()[/icode] on the associated data table.

Member Avatar for brianmanee
0
1K
Member Avatar for danielagaba

You should create a DataSet with the IDE and use it OR you should just execute your queries dynamically without the use of a DataSet. I personally don't consider creating a DataSet in code functionally identical to a designer generated DataSet. Since an INSERT can have triggers that execute post-update …

Member Avatar for jigar.makhija
0
968
Member Avatar for ryy705

[B]>>Try using WebRequest instead of HttpWebRequest:[/B] What does that have to do with the problem though? WebRequest is an abstract base class for Http requests, Ftp requests, etc. Even in your code its still creating an HttpWebRequest based on the URI format: [code] private void button3_Click(object sender, EventArgs e) { …

Member Avatar for Kumar_1
0
679
Member Avatar for priyamtheone

You answered your own question. MSDN recommends it so yes. Anything implementing IDisposable should be disposed when it is no longer needed. Local variables are not destroyed immediately when they go out of scope but they are no longer accessible. Calling dispose immediately frees up any resources it can then …

Member Avatar for Momerath
0
214
Member Avatar for Tank50

You should never call the garbage collector from code: [icode]GC.Collect();[/icode]. Also that is the expected behavior of the Excel assembly. Think about it -- you're calling SaveAs() which is a [icode]void[/icode] method meaning you can't return a value. If you call [icode]SaveAs()[/icode] then you expect the file to be saved. …

Member Avatar for ddanbe
0
1K
Member Avatar for mania_comp

Regardless of whether or not the scanner is USB or Keyboard it will basically send key presses like a keyboard so that doesn't matter as far as your application is concerned. Secondly the barcode scanner can be programmed with a barcode prefix and suffix. This information and programming barcodes can …

Member Avatar for Dina_Du
0
458
Member Avatar for RekaRajagopal

[icode]SqlConnection[/icode], [icode]SqlCommand[/icode] and [icode]SqlDataReader[/icode] all implement [icode]IDisposable[/icode] and should be cleaned up in code or wrapped in [icode]using()[/icode] statements: [code=c#] /// <summary> /// Concatenates the query string /// </summary> /// <param name="Sql"></param> /// <returns></returns> private static string GetText(List<string> Sql) { StringBuilder sb = new StringBuilder(); for (int i1 = 0; …

Member Avatar for BMXDad
0
972
Member Avatar for Arjun_Sarankulu

Type initializers can fail for a number of reasons. The exception being thrown should have an InnerException with more detail as to why initialization failed.

Member Avatar for AndrewGrinder
0
10K
Member Avatar for darkocean

Welcome to Daniweb darkocean! Please use code tags when posting code To answer your question you can delete a single row this way: Excel.Range ran; ran = (Excel.Range)this.Application.Rows[12, missing]; ran.Select(); ran.Delete(Excel.XlDirection.xlUp); To delete multiple rows: //Get a set of cells in the rows Excel.Range rng = ws.get_Range("a12", "A14"); //Then act …

Member Avatar for santiagoivan.santana
0
9K
Member Avatar for penguin22

You can also use the mailto: extension to open up the default email client: [code=c#] private void button1_Click(object sender, EventArgs e) { string to = "test@gmail.com; test2@gmail.com"; string subject = "test subject"; string body = "test body"; MailTo(to, subject, body); } public static void MailTo(string To, string Subject, string Body) …

Member Avatar for Ketsuekiame
0
1K
Member Avatar for vishalonne

Thanks serkan ;) For installing SQL2005 you will want to use the command line args. Here they are for SQL2005: [code] //setup.exe /qb ADDLOCAL=SQL_Engine,SQL_Data_Files,SQL_Replication,Client_Components,Connectivity,SQL_SSMSEE INSTANCENAME=SrvMgrEnt SAVESYSDB=1 SQLBROWSERAUTOSTART=1 SQLAUTOSTART=1 AGTAUTOSTART=1 SECURITYMODE=SQL SAPWD=PASSWORD123 DISABLENETWORKPROTOCOLS=0 ERRORREPORTING=1 SQMREPORTING=0 ADDUSERASADMIN=1 INSTALLSQLDIR="%ProgramFiles%\Microsoft SQL Server\" [/code] To assemble them in code you only need to modify a …

Member Avatar for Jackson Kumar
0
243
Member Avatar for S2009

You should do analysis on your log files to deteremine the number of visitors. Check out "smarter stats."

Member Avatar for mohan221
0
2K
Member Avatar for mania_comp
Member Avatar for anandd
0
2K
Member Avatar for Kamlesh_sj08

One of the biggest causes for memory leaking is event handlers not being removed. I highly suspect that somewhere you're not cleaning up resources. Keep up your investigations with the memory profiler

Member Avatar for gerdal
0
616
Member Avatar for rinu.urs

>>1)is there any connection string ? Please see code below >>2)if so i am using windows authendication in sql server 2005 management studio so am not entering any user id and password to enter in sql server Please see code below >>3)so what should be the userid and password for …

Member Avatar for Reverend Jim
0
1K

The End.