2,245 Posted Topics
Re: Also take a look at [icode]System.Diagnostics[/icode], specifically the [URL="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx"]Process[/URL] class. | |
Re: Please use code tags when posting code/config files on daniweb: What are the permissions on the .htpasswd file? `ls -al /var/.htpasswd` Do you see any error messages in `/var/log/apache2/`? Also the password hashes for htpasswd are weak, so you should change the password since you posted it up here. I … | |
Re: You may have outbound FTP filtered. type [icode]iptables-save[/icode] as root on the command prompt and paste the data back here. Also are the two machines you tested on the same LAN? IE 10.1.1.1 = router 10.1.1.2 = broken machine 10.1.1.3 = working machine And you have confirmed they are using … | |
Re: [code] --Get a test environment set up IF OBJECT_ID('tempdb..#Table', 'U') IS NOT NULL DROP TABLE #Table Create Table #Table ( ID int PRIMARY KEY, [Server] varchar(10), [Target] varchar(10), [Action] varchar(10) ) Insert Into #Table (ID, [Server], [Target], [Action]) Values (1, 'a', 'b', 'attempt') Insert Into #Table (ID) Values (2) Insert … | |
Re: Do something like this: [code] Select Invoice.LocNumber, (Cast(Floor(Cast(OrderDate as float)) as datetime) - DatePart(day, OrderDate) + 1) As YrMo, Sum(InvDetail.RptAmt) As Sales From Invoice Inner Join InvDetail On (Invoice.InvNumber = InvDetail.InvNumber) Group By Invoice.LocNumber, (Cast(Floor(Cast(OrderDate as float)) as datetime) - DatePart(day, OrderDate) + 1) Order By Invoice.LocNumber, YrMo [/code] This … | |
Re: [B]>>Have you tried a HAVING clause instead of a WHERE clause? I don't really understand the difference, but sometimes HAVING works when a WHERE doesn't[/B] [icode]HAVING[/icode] is used on aggregate comparisons while [icode]WHERE[/icode] is used for row comparisons. Regarding the original poster's query: [code] SELECT TS.col1, TS.col2, count(*) AS Number … | |
Re: I had that problem when I upgraded an ASP.NET project from an older version of visual studio and it created a backup directory. Even though I wasn't attempting to browse files in the backup directly it made IIS blow up because the old config file was accessible inside of the … | |
Re: Same has been happening here for a little while. I click the "Join Us!" link then it lets you sign up for a new account or login without the javascript changing around the page. | |
Re: Buy a new router and hope it fixes the problem. Get a WRT54G. There are things you could do for diagnostics but it takes a long time and in my opinion isn't it. I would rather spend $50 and get on with things :) | |
Re: Visual Studio has to be getting the source from somewhere. You don't get the source code in a debug or release build (yes you can decompile it, but the IDE doesn't). That being said it depends where the IDE is pointed to. | |
Re: On line 14 (from the code in your post) add: [code] File.Copy(Filelocation, @"C:\path\to\new\image.jpg"); [/code] | |
Re: [B]>> Is this exceptional or every IT companies in US are screwing it's employee like this ?[/B] I don't know that I would go so far as to say they're "screwing" employees. I like to start work ~2am and be out the door by noon so I can attend school. … | |
Re: You need to use parameterized SQL. This question was asked in other threads: [url]http://www.daniweb.com/forums/thread214619.html[/url] [url]http://www.daniweb.com/forums/thread209172.html[/url] I believe those are both C# posts but the VB.NET code would look like: [code=vb.net] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'Insert an image Using conn As New System.Data.SqlClient.SqlConnection("Data … | |
[B]Hello daniweb![/B] I figured I would go ahead and introduced myself now. I have been test driving the site to make sure I wanted to stay before I introduced myself -- its not that I forgot. After being a member for a few months I have decided to stay. I … | |
Re: Using the KeyDown event of the text box for capturing Enter isn't always safe. If the form has a [icode]DefaultButton[/icode] set then the button will receive the Enter key press, and the textbox event will never fire. What you can do is override [icode]ProcessCmdKey()[/icode]: [code] private void frmTestKeyDown_Load(object sender, EventArgs … | |
Re: You shouldn't hard code filenames like that. Have a "Settings" form where the user can invoke an OpenFileDialog() and select the database file. Store the FileName/FullName property to a string value in your application configuration file. | |
Re: [B]>>Iam new to C# and I need help with creating a dynamic web form using C#.[/B] Your post was for a [B]windows[/B] form, not a [B]web[/B] form. And as avirag asked -- what problems are you having? | |
Re: [code] IF OBJECT_ID('tempdb..#GST', 'U') IS NOT NULL DROP TABLE #GST CREATE TABLE #GST ( EffectiveDate datetime NOT NULL, TaxRate float NOT NULL, CONSTRAINT PK_GST PRIMARY KEY NONCLUSTERED (EffectiveDate) ) GO Insert Into #GST (EffectiveDate, TaxRate) Values (Cast('2004-01-01' as datetime), 5.0) Insert Into #GST (EffectiveDate, TaxRate) Values (Cast('2007-07-01' as datetime), 7.0) … | |
Re: ZIP and upload your project by clicking "Go Advanced" then "Manage Attachments". There are a number of things that could be going wrong here. | |
Re: When you execute the script write out a PID file. Cron the script to run every 30 minutes and kill itself. You should be able to modify this code to suit your needs: [code=php] class pid { protected $filename; public $already_running = false; function __construct($directory) { $this->filename = $directory . … | |
Re: Are those code classes in the same assembly? It seems the second class can't find a definition for the first class. Also this is a bad idea: [code] public int ExecuteNonQuerywithMultipleTrans(SqlTransaction sqlTrans, string storedProcedure, SqlParameter[] param) { int returnResult = 0; try { returnResult = SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, storedProcedure, param); return … | |
Re: Yes. In your AssemblyInfo.cs add this: [code] [assembly:RuntimeCompatibilityAttribute(WrapNonExceptionThrows = true)] [/code] Then to catch the exception: [code] private void button3_Click(object sender, EventArgs e) { try { //c++ call } catch (System.Runtime.CompilerServices.RuntimeWrappedException ex) { MessageBox.Show(ex.Message); } } [/code] | |
Re: This is a bad idea. You should not create the record if you intend to delete or have a "quotes" table for storing data before it becomes a live invoice. If you create invoice #5 and then add a payment to invoice #5, then delete invoice #5 and recreate it, … | |
Re: You will want to do all traffic throttling in front of the network or machine. So if you want to throttle you webserver then use the router in front of it. What type of router do you have? | |
Re: [code] Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click Const input As String = "John said 687" Dim words() As String = input.Split(New [Char]() {" "c}, System.StringSplitOptions.None) Dim lastWord As String = words(words.Length - 1) MessageBox.Show(lastWord) End Sub [/code] | |
Re: You also need to set "Integrated Security=False;" when using a username/password connection string. Here are example connection string builders: [code] public static string BuildSqlNativeConnStr(string server, string database) { return string.Format("Data Source={0};Initial Catalog={1};Integrated Security=True;", server, database); } public static string BuildSqlNativeConnStr(string server, string database, string username, string password) { return string.Format("Data … | |
Re: Well you should probably use the thread pool and stay away from creating threads with the [icode]Thread[/icode] class and the background worker. Unfortunately I primarily do C# development and could whip this up a lot faster but its taken me 30 minutes to find all the VB.NET equivelants for this … | |
Re: How do you determine the date of the item? The lasDateOf column? I have answered a similar thread about finding records regarding a payment date: [url]http://www.daniweb.com/forums/thread222265.html[/url] Here is an example of selecting all invoices older than 90 days: [code=sql] Select * From Invoice Where OrderDate <= Cast(Floor(Cast(GetDate()-90 as float)) as … | |
Re: What problems are you having are right now? Post your code and issue symptoms. There are a lot of things that could go wrong with an sql connection. | |
Re: No, why would there be? Pages are destroyed in ASP.NET applications after the server renders the page. Object states are stored in the viewstate so on a postback the page can be recreated. Now with windows forms the objects are never destroyed until you destroy them. What do you need … | |
Re: Use [URL="http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx"]System.IO.Ports.SerialPort[/URL]. You will find sample code for using [icode]SerialPort[/icode] in the link provided | |
Re: You can add a rowfilter to the default view of the [icode]DataTable[/icode]: [code] gridTable.DefaultView.RowFilter = "CompanyName < 'I'"; [/code] | |
Re: [QUOTE=Ionelul;1091684]if you use LinqToSql, there is an easier way to do the insert. Check the following link for a good tutorial: [url]http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx[/url] Ionut[/QUOTE] I have seen you recommend LINQ to SQL a number of times but not every query-related question is best solved with LINQ. Also I don't know that … | |
Re: What does [icode]txtPath.Text[/icode] evaluate to at run time? If you're running as a non-admin and attempt to save to another user's profile path, for example, it will give you that error. | |
Re: The problem here is that you don't have a picture in the database for that particular row, you have a null value in the database instead. You need to check for a null value before attempting to load the image: [code] Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As … | |
Re: How is that data structured? Are those numbers always guaranteed to be in the exact same position? If so you could read the middle of the string. Or will the number always start N positions after the N'th decimal number? | |
Re: Change the font/locale you're using. Take a look at: [URL="http://msdn.microsoft.com/en-us/library/dc6bb2eh(VS.71).aspx"]Arabic or Hebrew Text in Object Names[/URL] While it isn't directly answering the question you asked it is does explain multilingual support | |
Re: [B]>>But I just want to know why the "not so correct" approach is not working....[/B] Danny already gave you the answer. The best practices for .NET development is to not expose fields publicly, only properties. Allowing you to bind to public properties (with get/set) and data sources helps enforce those … | |
Re: There are a few solutions. If you know you will only need to ever concat up to, say, 6 values then you could hardcode a solution: [code] IF OBJECT_ID('tempdb..#Table', 'U') IS NOT NULL DROP TABLE #Table Create Table #Table ( Column1 varchar(4), Column2 varchar(4) ) Insert Into #Table (Column1, Column2) … | |
Re: Familiarize yourself with the [URL="http://msdn.microsoft.com/en-us/library/system.threading.interlocked.aspx"]System.Threading.Interlock[/URL] and [URL="http://msdn.microsoft.com/en-us/library/system.threading.monitor.aspx"]System.Threading.Monitor[/URL] namespaces for threadsafe best practices. Here is a stub class for a mail checker. You pretty much just need to complete the [icode]CheckMail()[/icode] method for downloading the messages. Depending on the behavior you want the class is plumbed to fire events either asynchronously … | |
| |
Re: The where condition of your query is wrong. Use: [icode]Where plan_id = [COLOR="Red"][B]@plan_id[/B][/COLOR][/icode] And: [icode]cmd.Parameters.Add("@plan_id", SqlDbType.Int, value);[/icode] | |
Re: As far as I know you have to iterate all processes and call [icode].GetOwner()[/icode] in WMI. This is a very slow way to iterate process. see this post: [url]http://www.daniweb.com/forums/thread249799.html[/url] See this article: [url]http://www.codeproject.com/KB/cs/processownersid.aspx[/url] | |
Re: Usually with that kind of internet access when you connect you're put on an internal network. When you're connected to that network the provider will resolve any hostname and respond to all traffic and redirect browser requests to their payment site. After you pay and authenticate they put you on … | |
Re: That depends on where you're trying to capture the change. You can create a trigger for update/insert/delete to compare before and after values of a transaction. Are you trying to do this at the application level to show modifications or at the database level for audit trails? | |
Re: What does "loop a connection" mean? | |
Re: Can you upload a sample project demonstrating the issue? I spend a considerable amount of time implementing the same feature with .NET Remoting altough remoting is less robust than WCF. Also what lines blocks for the timeout period? Looking at this code: [code] public void NotifyClient(string message) { ReceiveDelegate receiver … | |
Re: [icode]float[/icode] is not a precise data type. You should probably be using the [icode]money[/icode] datatype in SQL server to store currency values. Take a look at SQL BOL for float: [quote] Approximate-number data types for use with floating point numeric data. Floating point data is approximate; therefore, not all values … | |
Re: Can you upload a sample file with at least 5 records of data and what your desired output would be? | |
Re: What are you trying to do? Looking at this code I would say this is a bad idea: [code] localMachineInfo = Dns.Resolve(string.Empty); localEndPoint = new IPEndPoint(localMachineInfo.AddressList[0], _port); [/code] You have multiple local addresses on any given machine. Typically you have a LAN ip address of 192.168.x or 10.x.x.x and you … |
The End.