15,885,546 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by sjelen (Top 175 by date)
sjelen
6-Nov-14 9:41am
View
try calling objRunspace.Close() explicitly.
Since both PowerShell and Runspace implement IDisposable you can use 'using' block
using (var powershell = PowerShell.Create()){
...
using (var objRunspace = RunspaceFactory.CreateRunspace()){
...
}
}
Then you don't have to worry about calling .Dispose() it'll be called automatically when execution exit using block.
sjelen
25-Oct-13 11:35am
View
OK, 'never' is maybe too strong.
But you never know when will Designer decide to re-gen the file and overwrite manual changes.
sjelen
25-Oct-13 10:57am
View
What exception is thrown?
sjelen
25-Oct-13 10:22am
View
Have you modified Designer.cs file manually? That's never a good idea.
Do you have any compiler errors when you build app?
Are you able to run app? Is menustrip visible when you run it?
sjelen
1-Jul-13 7:28am
View
You have that line in two places in your code. Which one causes the error?
sjelen
27-Jun-13 9:49am
View
The problem can be anywhere form network connectivity issue, remote database configuration to local connection string.
Try to ping remote host to see if network is OK.
Are you able to connect to remote database using MySQL admin tools?
Does the database you're trying to connect to allow remote connections?
Check IP/hostname and credentials in your connection string, user and password might be different for remote database.
sjelen
26-Jun-13 4:49am
View
JavaScripSerializer is available since .NET 3.5 and you need to reference System.Web.Extensions.dll
You could also use a very popular library Json.NET: http://james.newtonking.com/pages/json-net.aspx
or if you don't want 3rd party library you can use System.Runtime.Serialization.Json.DataContractJsonSerializer class:
http://msdn.microsoft.com/en-us/library/system.runtime.serialization.json.datacontractjsonserializer.aspx
sjelen
25-Jun-13 10:19am
View
If you don't want postback just set AutoPostBack="false"
sjelen
25-Jun-13 9:59am
View
Good point, OP did not specify from where he will be consuming web service, I just assumed it's from browser.
sjelen
25-Jun-13 9:43am
View
The event handler code does not need to be in treeview class. You can put it in your richtextbox class and it'll have access it needs.
Then, in main form, right after both treeview and richtextbox are instanced you can wire up treeview event with handler from richtexbox class, something like:
MainForm.MyTreeView.Click += new System.EventHandler(MainForm.MyRichTextBox.MyClickHandler);
sjelen
25-Jun-13 7:36am
View
If it's WCF web service, take a look here:
http://www.codeproject.com/Articles/89858/WCF-Concurrency-Single-Multiple-and-Reentrant-and
It can be achieved through configuration.
sjelen
25-Jun-13 7:25am
View
Not enough details, but it looks like javaScript problem. Provide the code for OpenChild function.
Is your grid inside UpdatePanel? Does it trigger server-side events?
sjelen
25-Jun-13 7:21am
View
What is the problem? What error/exception are you getting?
sjelen
13-Mar-13 11:59am
View
Do not edit design file manually, it's auto generated whenever you change something in designer and you might loose your code.
Set your event handler from designer or from code in .cs file, never in .designer.cs
sjelen
13-Mar-13 11:22am
View
I think the error was in arguments string, it was:
D:\JMeter\apache-jmeter-2.8\bin>jmeter -t D:\TestRun.jmx
should be:
D:\JMeter\apache-jmeter-2.8\bin\jmeter -t D:\TestRun.jmx
I corrected it.
Also see my alternative solution.
sjelen
11-Mar-13 13:57pm
View
Rewriting URLs in web forms app is not that easy, ASP.NET depends on file extension to find appropriate handler for a request.
Also some server controls render URLs in their output, so you would need to rewrite both request and response.
If you're making a new application and want URLs to look like that, consider using ASP.NET MVC framework instead of web forms.
sjelen
11-Mar-13 13:43pm
View
It's a bad idea to have connection strings hard coded in .cs files. Put your connection strings in a config file (connection strings section) and make your app read them on start. That way you can change them easily without editing and re-compiling the code.
sjelen
11-Mar-13 10:20am
View
What have you tried? What is the problem?
sjelen
11-Mar-13 8:07am
View
Managed code runs inside CLR (Common Language Runtime) which has it's own memory management including a garbage collector.
Unmanaged code runs directly on top of OS (no runtime enviroment, no garbage collector).
Unmanaged code can't access managed memory directly (I guess that's the error you're getting). You need to copy data from managed memory to unmanaged memory and use that copy as parameter to unmanaged method. The result from unmanaged method also has to be copied back to managed memory before it can be used by managed code.
This process is called marshaling and Marshal class has many methods to make this easier.
In some cases can also be done by using 'MarshalAs' attribute on parameters and return type.
Take a look at articles I added above.
sjelen
8-Mar-13 12:11pm
View
Improve your question with some relevant code, so we can see what you are trying to do.
sjelen
8-Mar-13 7:15am
View
How can you expect anyone to help you when you did not provide any relevant information.
sjelen
28-Feb-13 13:03pm
View
One problem could be that you're not closing all data readers when you finish reading.
The other is that you are 'nesting' readers and this increases number of concurrent connections.
Try redesigning your code to avoid this nesting.
sjelen
27-Feb-13 7:01am
View
The assembly you're referencing was probably compiled only for x86 (not for x64 or 'Any CPU').
You can either try to find x64 version of assembly, or you can compile your application explicitly for x86 (in VS: Project properties -> Build tab -> Platform target)
sjelen
27-Feb-13 6:47am
View
Thanks.
sjelen
22-Feb-13 8:01am
View
Post a example of how you use AddTemplateToGridView if you need more help.
sjelen
21-Feb-13 8:39am
View
To access a control on postback you can use FindControl method on a container control.
For this to work, the whole control hierarchy must be created. It's done automatically for designer controls by designer-generated code during page Init.
But for runtime generated controls you have to make sure all controls are re-created on postback.
(Read on ASP.NET page life-cycle)
Post a example of how you use AddTemplateToGridView if you need more help.
sjelen
21-Feb-13 6:59am
View
this is C#, use :
images[i]
not:
images(i)
sjelen
19-Feb-13 12:59pm
View
Look at the stack trace of exception - it should point you to the relevant piece of code, where the problem lies.
Are you using recursion? That can cause problems.
Look for memory allocations (using of 'new' keyword), specially with any large objects your app may use and inside large loops.
sjelen
8-Feb-13 5:40am
View
Yes and that is why your app works on dev machine - component is registered after the build.
Regasm does more than create .tlb, it also creates registry entries so Windows knows where to find your library.
If you want app to run on other machines you need to run regasm on each machine you want to use.
Or create installer to do that for you.
sjelen
6-Feb-13 7:44am
View
You'll need to know the inner workings of CArchive or at least the structure of binary file it creates.
What exactly did you try, that error does not seem to come from FileStream alone?
A code sample would be helpfull.
sjelen
6-Feb-13 7:18am
View
See the code in updated answer.
sjelen
5-Feb-13 12:37pm
View
You probably didn't make the request right, so the server responded with 'internal server error'.
Maybe you used bad URL, or forgot to authenticate if needed.
The error is not because you used WebRequest class, but because target server could not process your request.
Why don't you try using WebClient.DownloadString method (http://msdn.microsoft.com/en-us/library/fhd1f0sw.aspx)
It will download the page as a string.
Or add a code sample so we can see what you're trying and help you find the problem.
sjelen
5-Feb-13 7:45am
View
What is the question? What exactly isn't working? What have you tried? Improve your question.
sjelen
5-Feb-13 7:12am
View
Use 'Improve question' and give us an example of your code (html, javaScript, css3)
sjelen
4-Feb-13 10:23am
View
check your javascript, either your function is not declared to be visible from page or there is js error somewhere before function is declared and processig of .js file is aborted.
sjelen
1-Feb-13 9:08am
View
check if any errors are reported by sql server.
Since you use integrated security, it's possible that account you're running from does not have privilege to create database.
sjelen
31-Jan-13 10:54am
View
Which version of MSAD Engine did you install, 32bit and 64bit?
Also is your app compiled as x86, x64 or AnyCPU?
Your app and driver need to be the same version - otherwise app can't load excell driver.
If you compiled as AnyCPU, I guess it will be executed based on OS version (and installed .NET version).
Also, on download page it states that this library should not be "called from server-side web application such as ASP.NET"
sjelen
31-Jan-13 10:37am
View
I don't think it's threading problem. If it was you would be getting error on development machine too.
If I understood correctly, you made COM component using C# and SerialPort. Then you use that component from VB6?
If so, I guess you forgot to register that component on other machines (or re-register when you changed something) and your app can't load it.
sjelen
31-Jan-13 7:09am
View
What else part are you talking about - you didn't show that code? Page is supposed to postback on button click, that's how ASP webforms work.
Explain what you are trying to achieve.
sjelen
24-Jan-13 12:16pm
View
What is painful, thinking or typing? ;)
sjelen
24-Jan-13 12:14pm
View
+5 for you effort :)
One thing you missed:
c = a - b;
textBox10.Text = c.ToString(CultureInfo.CurrentUICulture);
long status = Convert.ToInt64(textBox10.Text);
last line is unnecessary, 'status' will always be equal to 'c', no need for double conversion.
sjelen
24-Jan-13 12:05pm
View
Thanks.
sjelen
24-Jan-13 9:13am
View
You did not explain what your problem is or what is the error you get.
There are so many wrong things in this code, I wouldn't know where to begin.
sjelen
24-Jan-13 8:42am
View
Seems like big-endian/little-endian conversion problem.
Why don't you try to fix endianness while reading bytes from the device instead of messing around with strings?
sjelen
23-Jan-13 10:50am
View
Is this error exactly on this line of code? What type of object is 'combobid'?
What kind of application are you making: web-forms, MVC, win-forms, WPF, SilverLight?
I can't help you without more info.
I guess you're making desktop application. My original solution is for web application.
You should use 'combobid.SelectedText' or 'combobid.SelectedValue.ToString()',
depending on how you bind data to combo box.
sjelen
23-Jan-13 5:50am
View
You're welcome.
sjelen
23-Jan-13 5:48am
View
This is absolutely correct way to get selected value from DropDown control.
If it doesn't work for you, you have a problem elsewhere or you're doing it wrong.
Down-voting an answer without explanation is rude.
sjelen
21-Jan-13 12:26pm
View
Go to "Tools -> Fiddler Options -> Connections" and check "Act as system proxy..." and delete anything in "Bypass Fiddler for URLS ...."
Remember the listening port (8888 by default).
Add this to app.config of your client app (change the port if not default):
<system.net>
<defaultproxy enabled="true">
<proxy bypassonlocal="False" proxyaddress="http://127.0.0.1:8888"/>
</defaultproxy>
</system.net>
Also you might need to add 'bypassProxyOnLocal="false"' attribute to your binding configuration.
sjelen
17-Jan-13 11:27am
View
In that case I would use port forwarding. You'll need to forward port that your chat application uses and map it to the local network IP address of the computer you want to connect to. It's easier to setup if your computer uses static local IP, not DHCP.
And please use "Have a Question or Comment" button to post additional question, do not post a question as solution.
sjelen
17-Jan-13 7:42am
View
Also consider using basicHttpBinding, it supports transport level security (SSL) and in many cases that's enough. It's much easier to code manually.
Use wsHttpBinding only if you really need message level security or other WS extensions.
sjelen
17-Jan-13 7:08am
View
That's because you wrote it like that. You're not reporting real progress, just simulating it.
cdr.OpenDocument obviously works synchronous, so while it works your loop for 'progress reporting' is not executed yet.
I don't know what library you use and what is CorelDRAW.Application object, so I can't help further.
You can report real progress only if this object supports that. Does it have some events you can attach to?
Or you can cheat :) : have 2 background workers, one to open the document, the other to fake progress.
sjelen
20-Dec-12 8:07am
View
What does 'unable to call' mean? Are you unable to build the code or are you getting errors/exceptions?
Or your function just does not get called?
sjelen
10-Oct-12 12:48pm
View
In theory, you could use BLOB field to store video in db as binary data.
In practice, this is not a good idea. Relational DBs often have poor performance, specially with large binary data like video. Streaming the video from DB is also problematic.
If it has to be in a database, you should try some NoSql engine like MongoDB.
sjelen
5-Oct-12 13:03pm
View
If I counted ok, that's output file, it has to be opened in write mode.
What is the other process that uses it?
Did you opened it in some editor?
sjelen
4-Oct-12 6:55am
View
Ok, you're right. But your original code was replacing first occurrence in whole text, not in each line, and the problem was not in ReplaceFirstOccurrance but in Transform_Click.
I've updated the solution to use your ReplaceFirstOccurrance()
sjelen
2-Oct-12 12:09pm
View
And what is the error you get?
sjelen
2-Oct-12 7:10am
View
I guess he means 'sign language'
sjelen
27-Sep-12 11:59am
View
Can you share your code so we can get better understanding of problem?
What do you mean by 'headless'? A console application? A Windows service? Web application?
sjelen
27-Sep-12 9:26am
View
Install Expresso and play around with regexes, it's not that hard to learn.
Soon it will be quicker for you to write your own regex than to post a question here
sjelen
25-Sep-12 12:04pm
View
I'm out of ideas. Check what value is actualy POSTed (use fiddler or firebug).
If it's OK, then perhaps somewhere you re-bind DropDownList and lose the new value.
sjelen
25-Sep-12 11:08am
View
Since it's in the first column it should be
ddlfunc2 = e.NewValues[0].ToString();
sjelen
25-Sep-12 10:58am
View
What kind of device are you using?
What protocol does device use to transmit data?
sjelen
25-Sep-12 10:55am
View
Sorry, forgot to delete the loop :)
sjelen
25-Sep-12 10:16am
View
In DetailsView1_ItemUpdating have you tried to get new field with
e.NewValues
sjelen
25-Sep-12 9:26am
View
And what do you put in TextBox?
Is it hexadecimal string representation of image, or base64 encoded image, or something else?
sjelen
25-Sep-12 7:19am
View
Your solution is for WebForms, not for WinForms.
sjelen
25-Sep-12 7:14am
View
This is copying from one stream to another, not 'converting'
sjelen
25-Sep-12 7:13am
View
MemoryStream is a Stream. What do you mean by 'convert'?
sjelen
25-Sep-12 7:03am
View
Is DetailsView1 inside 'editPanel'? I just saw that you're adding this panel to ModalPopupExtender at runtime. Why would you do that? Where is 'editPanel' located initially?
When you execute "ModalPopupExtender1.Controls.Add(editPanel);" you change page's control tree. On next postback (update) if you do not do the same asp.net does not know where to find control (it looks in the original location of editPanel instead inside extender.
Can you remove this line and try again? This is not the way to use this extender anyway.
sjelen
24-Sep-12 11:57am
View
That would mean ASP can't find the dropdown control.
Is 'ddlfunctions' declared in markup or do you add that control dynamically at runtime?
Can you show markup for DetailsView1?
sjelen
24-Sep-12 11:35am
View
You can't. You need a way to uniquely identify a record you want to delete in the database.
Otherwise, you might accidentally delete multiple records.
DataGrid's row number does not have anything to do with database - it's generated in code, not in DB.
sjelen
24-Sep-12 8:45am
View
If it helped, then mark it as solution.
sjelen
24-Sep-12 8:01am
View
It's a single int.
Just put it in a loop...
Or combine it with Solution 2
Or take a look at updated solution.
sjelen
21-Sep-12 6:30am
View
did you check folder names? You say you save images to "/anjoman/picgallery", but in html you refer to "gallerypic" folder.
Also, I think that application root '~' only works with server-side controls, try <asp:Image> instead of <img>, or try <img runat="server" ...
sjelen
18-Sep-12 10:49am
View
Make sure the database isn't open in Access when your application is running.
It will lock the file and prevent writing data from your app.
sjelen
18-Sep-12 10:42am
View
Try to add it page OnInit override. That's earlier in page life-cycle so runtime will have a chance to parse values from request for you.
The other option is to read values by id directly from Request.Form[].
Without exact code I can't help you more.
sjelen
18-Sep-12 7:32am
View
Can you show some relevant code showing you usercontrol, how do you add it to the page and how do you try to read from it?
sjelen
18-Sep-12 7:27am
View
Code you presented will give you IP address of local computer, not the remote IP address of incoming connection.
You do not need DNS for this. When you accept an incoming connection, you get the address of remote endpoint.
sjelen
17-Sep-12 11:40am
View
Are the images (jpg files) on file system?
In that case can you show us folder structure?
Where is the page located, related to images folder?
You're probably having trouble with relative paths.
sjelen
17-Sep-12 11:28am
View
Take a look at url in updated solution.
It looks like Marshal.StringToCoTaskMemUni() should be used.
sjelen
17-Sep-12 6:21am
View
What part you don't understand?
ReadHexFile() reads a text file that contains hexadecimal representation of binary data into a byte[].
Regex is user to eliminate all whitespace an other non-data characters.
Then in the loop the string containing hex values is split into 2 char substrings
and each one is parsed to a byte and put in the array.
sjelen
13-Sep-12 13:03pm
View
You're treating text files as binary, you made the same mistake here:
www.codeproject.com/Answers/444145/Trying-to-Port-a-C-MD5-Hash-Collision-Program-to-C
sjelen
13-Sep-12 12:53pm
View
Since this is happening on postback, make sure you have populated datatable before reaching this code.
If you're not keeping datatable in Session, you'll need to fill it with data again on postback.
Provide more code using "Improve Question".
sjelen
10-Sep-12 6:55am
View
Firebug should also give you status code for that request, what is it?
If it's 404 double check your paths and files on IIS deployed application.
Also check if ".mp4" extension is registered in IIS with StaticFileHandler.
sjelen
5-Sep-12 10:19am
View
How does your datasource looks like?
Maybe DetailsView would be more appropriate in this case.
sjelen
4-Sep-12 7:58am
View
check you settings for myComPort.Encoding, if you set it wrong ReadExisting and ReadLine may return unexpected results.
you can customize ReadLine behavior by setting myComPort.NewLine property - string that will be interpreted as new line separator.
sjelen
4-Sep-12 7:44am
View
Your question does not provide enough info, improve question with more details and a code snippet.
sjelen
30-Aug-12 6:32am
View
getdate() is MS SQL function that returns current date and time, same as DateTime.Now in C#.
This will calculate age as years, if you need "year, month, day" take a closer look at DATEDIFF function.
It can calculate date difference in many ways.
sjelen
28-Aug-12 7:47am
View
Yes, you can remove it just in this method. It will be there again on next postback.
this.Controls.Remove(ModalPopupExtender1);
sjelen
28-Aug-12 7:37am
View
Looks like WCF is having trouble serializing your data. Either your data is too big or you may have circular references in your data structure.
How big is your Klant object? What does it contain?
What exactly does DataTransferObjectMapper.Mapper.ToDataTransferObject methode do? (code)
If you're hosting your service on IIS check it's logs and EventViewer for errors.
sjelen
24-Aug-12 9:35am
View
This really depends on how you setup and initialize gvDetails (assume this is GridView).
sjelen
24-Aug-12 9:10am
View
Hard to tell what is the problem from this. Have you tried to debug WCF? What happens when you step over "klanten.Select ..." statement?
sjelen
21-Aug-12 12:33pm
View
I have used the same example, just removed all spaces and new-lines from file.
I do get the same hash for both files.
See updated code, added regex to remove all whitespace from hex string.
sjelen
26-Jul-12 7:04am
View
href and text are "named groups" here. If you have:
Match m = regex.Match(inputText);
then (using you input example):
m.Groups["href"].Captures[0].Value gives "http://www.domain.com/T60B8JK2WT/"
m.Groups["href"].Captures[1].Value gives "http://www.domain.com/5FBLQYBQTV/"
m.Groups["text"].Captures[0].Value gives "KungFu Panda - Legends of Awesomeness (2011)(1 - 22)"
m.Groups["text"].Captures[1].Value gives "KungFu Panda - Legends of Awesomeness (2011)"
sjelen
26-Jul-12 6:56am
View
Doesn't this work only if rectangles are aligned to X-Y axes?
Arbitrary rectangle in a plane can not be defined with only 2 points.
sjelen
26-Jul-12 6:46am
View
From your code we can't see what is the dictionary that is causing the problem.
Use F11 (step into) in debuger on 'string POS...' line and repeat that until you find the cause.
Also check the exception stack trace - it should point you to the real cause.
Probably you're missing some data in database y.
sjelen
25-Jul-12 6:42am
View
Have you added any strings to the list before you try to use FirstNo?
sjelen
2-Jul-12 12:55pm
View
There are many reasons for this, hard to tell without more details and code.
Check if session id header is sent along with AJAX request (use Fiddler or Firebug). If you're using 'Cookieless' sessions, you'll need to manually append session id to query string of your AJAX request.
When using generic handlers you'll need to implement IRequiresSessionState interface on it.
sjelen
5-Jun-12 13:03pm
View
Oh, the endless possibilities of LINQ extensions :) +5
sjelen
24-May-12 12:25pm
View
Good answer. I would just add this (since he can see image in designer but not in browser):
Make sure the image is accessible from application (file system permissions).
Best is to keep your images somewhere in your app folder hierarchy.
sjelen
21-May-12 10:54am
View
It's an extension method, member of System.Linq.Enumerable, located in System.Core (at least in .NET 4.0, not sure about previous versions).
Sorry for late reply, I see now it's already mentioned.
sjelen
21-May-12 10:42am
View
You can declare it only once - in validateform().
(if you do not use it somewhere else in your code)
sjelen
21-May-12 10:05am
View
The posted code does not demonstrate the error. Improve question and provide more details.
sjelen
21-May-12 9:42am
View
I don't think you can fire DOM body_load event, nut you could call event handler directly form a script (similar to example above) if it's named function (not anonymous).
sjelen
21-May-12 8:34am
View
DOM body load event is not fired for partial page updates (using UpdatePanel).
Correct way to handle this would be to use PageRequestManager and it's pageLoaded event, here is example:
http://msdn.microsoft.com/en-us/library/bb386417.aspx
Alse take a look at this nice article explaining ASP.NET AJAX framework:
http://www.codeproject.com/Articles/22384/ASP-NET-AJAX-Controls-and-Extenders
sjelen
21-May-12 8:16am
View
I've updated the answer, take a look.
sjelen
18-May-12 5:57am
View
In your code you expect that each row have 6 columns. If one of your CSV files has less than 6 columns you get that error. Depending on CsvFileReader maybe if even a single line in a file has < 6 colums you get the same error.
sjelen
18-May-12 5:47am
View
in that case you probably got the column name wrong. Can you put your TemplateField markup here?
sjelen
18-May-12 5:43am
View
Are you sure you're looking at the right place? You have here:
DataTable dt=new DataTable();
so DataTable is not null. Do you have another DataTable elsewhere in code?
Error message usually contains a line number where the error happen.
sjelen
17-May-12 7:30am
View
In that case TextBox is definitely bad choice. As Dave said, none of the form controls can achieve that refresh rate. If you just want to measure throughput why don't you (instead of displaying all data) just read the data from USB, get the number of bytes/frames read, use that to calculate current speed periodically and display speed in TextBox.
Anyway, even for drawing a waveform you'll need a buffer. Then myEventCatcher could read the data as it arrives from USB (as fast as it can) and store it in the buffer. On the other end you can have display control process/draw that data at it's own (slower) speed.
sjelen
17-May-12 5:50am
View
Deleted
Since he's trying to brows from the server, "RemoteOnly" option should be enough.
sjelen
16-May-12 6:48am
View
WinForms or WPF application?
sjelen
15-May-12 12:44pm
View
It's probably the easiest way to start, if you are not familiar with javaScript.
sjelen
15-May-12 12:37pm
View
objDyn is probably null. What is it? A control? Some custom class? Where do you initialize it?
sjelen
15-May-12 7:18am
View
I can not help you with implementation without knowing much more about your app.
If you want this game to look and work good, you really have to learn javascript. Get yourself familiar with some javaScript framework, like jQuery - it will make things easier for you.
sjelen
14-May-12 13:16pm
View
That's a good point.
sjelen
14-May-12 6:59am
View
Very interesting articles. +5
sjelen
14-May-12 6:55am
View
Your code seems fine, maybe your data is the problem. You have while loop that will add all records returned by query.
Do you have multiple records with the same IDName?
sjelen
14-May-12 6:40am
View
And what is the problem?
sjelen
14-May-12 6:16am
View
This is very general error description. If you expect help, provide more details and some code ilustrating your Gzip implementation
sjelen
14-May-12 6:11am
View
I don't see a problem here. Can you provide a sample of csv file? A bit more details on the problem?
sjelen
11-May-12 10:12am
View
Have you checked permissions on UNC path? Are you working on domain or workgroup network?
sjelen
4-May-12 13:15pm
View
This is not real export to excel - you are making a html file with .xls extension and rely on Excel to convert it for you.
sjelen
26-Apr-12 9:49am
View
what do you mean by "text stream site"?
sjelen
26-Apr-12 9:29am
View
import where?
sjelen
26-Apr-12 9:15am
View
Provide an example showing these classes.
sjelen
25-Apr-12 7:58am
View
What type of session do you use? in-proc, state server or SQL?
If you use in-proc (default) you're probably loosing session due to application restart/appdomain recycle.
sjelen
25-Apr-12 6:58am
View
There is no universal regex for this, you must specify exactly all formats you want to match.
sjelen
20-Apr-12 7:16am
View
This is not actually binding - just rendering a table on client side.
It will display the data, but sorting, paging or editing on GridView will not work this way.
sjelen
20-Apr-12 7:02am
View
"System.Diagnostics.Process.Start(docPath.Text);" on server side?
sjelen
17-Apr-12 11:03am
View
All you need is here:
http://msdn.microsoft.com/en-us/library/system.net.sockets.aspx
sjelen
12-Apr-12 10:24am
View
Where exactly is the problem in the code you posted?
You don't need (and can't have) 2nd sessionState to work with 2 databases.
You only need to declare 2 connection strings in web.config, one for each database you use.
sjelen
12-Apr-12 10:10am
View
It's possible I got him wrong, but he did left out the code used for comparison. So I assumed the problem arose when he set SelectedValue and DropDownList must (internally) use string comparison against it's list of values to find selected item...
I completely agree with conversion rules, you already got mu +5 for that.
sjelen
12-Apr-12 7:20am
View
In the example above ItemTemplate has an Image and a Label below it. You can bind your text to it. It doesn't have to be a Label, depends how you want it formatted.
sjelen
12-Apr-12 7:15am
View
No offense, but "use HTTPHandler" is a bit more direct then "as described in hundreds of resources."
sjelen
11-Apr-12 13:34pm
View
First, selecting actual image data is not necessary for binding to DataList - only an id of image. The way you wrote select might lead him to do just that and in this case image data would only create unnecessary SQL traffic.
Second, "as described in hundreds of resources." is not very helpfull to an obvious beginner. You could have provided at least a link to one of those resources.
No hard filings :)
sjelen
11-Apr-12 13:18pm
View
True, but I think this is not the issue here. DropDownList.SelectedValue is a string, so he must convert whatever data type he uses to string in order to set selected item.
sjelen
11-Apr-12 12:52pm
View
String.Format("{0:hh}", oDateTime);
should format like 04.
Can you show how do you bind or populate dropdownlists?
Maybe text in dropdownlist items are '01', '02',... and values are '1', '2'?
sjelen
11-Apr-12 12:15pm
View
How would you bind an image to DataList?
sjelen
10-Apr-12 13:25pm
View
This is correct, but editing 'hosts' file on intranet clients or registering alias in intranet DNS is also required. Otherwise, clients will not be able to resolve site alias to a IP address.
sjelen
10-Apr-12 11:37am
View
Edited: was "hh:ss tt", should be "hh:mm tt"
sjelen
10-Apr-12 11:25am
View
I see you're using ViewState to store DataTable.
But do you restore objDT from ViewState on postback?
You should do that before adding new row.
sjelen
6-Apr-12 6:07am
View
This should be very easy to solve using LINQ
sjelen
5-Apr-12 9:07am
View
Both solutions below will work, but you should consider having two separate columns in database. How would you sort records by last name in your current database?
sjelen
3-Apr-12 6:38am
View
Your question is not clear, improve question with more details/examples.
sjelen
29-Mar-12 7:37am
View
You want "Name" centered across "Name1" and "Name2"?
Try:
dgi.Cells.Add(new TableCell { ColumnSpan = 2, Text = "Name", HorizontalAlign= HorizontalAlign.Center });
Or if you're using CSS class to style table:
dgi.Cells.Add(new TableCell { ColumnSpan = 2, Text = "Name", CssClass="..." });
sjelen
28-Mar-12 5:41am
View
Yes, checking would be a good precaution, but since both iDefaultServerID and list of servers come from database I assumed the data is OK. Anyway you don't need a loop to check this, see updated solution.
sjelen
28-Mar-12 5:32am
View
Put a breakpoint in SetupServerCombo() and look at the data returned by PlattyData.GetServers(), specially the first row. Does anything look strange there?
sjelen
27-Mar-12 11:37am
View
cmbServer.SelectedIndex is already integer, no need to convert it.
You didn't show how you populate combobox items.
And the error probably is not caused by: cmbServer.SelectedValue.ToString()
It's Convert.ToInt32() giving the error, as it can not convert the value to int.
Put a breakpoint on that line and see the value of cmbServer.SelectedValue.
sjelen
19-Mar-12 13:52pm
View
'data itself' means the actual recorded sound.
It's usually a byte[] containing recorded data.
sjelen
19-Mar-12 13:37pm
View
Again, there is nothing wrong with this piece of code. The error must be somewhere else. If you can, post all your code, maybe we can find what's wrong.
What kind of device is attached to serial port?
Are you sure device is sending data continuously? You might need to write something to serial port every time before you can read from it.
sjelen
19-Mar-12 12:23pm
View
Where exactly did you put this code? In a button click handler? Or in BackgroundWorker DoWork handler?
sjelen
19-Mar-12 11:48am
View
The code under your question is correct. You need to provide more details about your application if you want more help, as Wes Aday said.
Does it work at all? Does it work only once?
Is the device connected to RS232 supposed to send data continuously, or you need to send 'read' command to it every time?
The code inyour question does not match the code in your comment above. Which one do you use?
sjelen
19-Mar-12 10:41am
View
Is the price for mango and peach same?
If it is then that's your problem - you're using fruitCost as DataValueField.
If 2 items have same price you have no way to know which one is selected.
You should use some unique value for each item.
sjelen
19-Mar-12 10:08am
View
Why downvote this solution? It's the same as Clifford's.
Don't downvote something only because you're too lazy to do some research.
sjelen
16-Mar-12 10:40am
View
Often those machines are connected via serial port so you would probably have to use System.IO.Ports.SerialPort class to read data from it. But the actual communication protocol depends on machine you're using.
There is an article here you could use as starting point:
http://www.codeproject.com/Articles/16653/A-Smart-Card-Framework-for-NET
sjelen
16-Mar-12 9:30am
View
Using System.Net.Mail does not turn your app into SMTP server. You can use it to make your app act as mail client, just set it up with same SMTP parameters you would use to configure the standalone email client (smtp server address, user credentials).
sjelen
13-Mar-12 10:56am
View
Do your own homework :)
It's c) and d).
sjelen
13-Mar-12 10:38am
View
A good place to start is http://pinvoke.net/
sjelen
6-Mar-12 10:01am
View
I tried, but editor keeps showing this as plain text :( ...
sjelen
9-Feb-12 9:19am
View
In that case you don't need TcpListener, look at updated solution.
I didn't try it but it should work.
sjelen
9-Nov-11 7:51am
View
What you are trying is something like 'zone transfer' - it is used to transfer all records between master and slave name servers in a domain.
In theory, this can be done by querying for "ANY" or "ALL" on the authoritative NS.
However for security reasons this type of transfer is usually restricted only between trusted IPs or networks, so you will not get all records.
In another words - it is only possible with name servers that allow zone transfer.
sjelen
8-Nov-11 11:28am
View
1. yes
2. take a look at this article:
http://www.codeproject.com/KB/IP/DNS_NET_Resolver.aspx
sjelen
24-Feb-11 11:57am
View
The exception suggests you are trying to use Request object, but it doesn't show in your code sample.
Provide some more details.
sjelen
21-Feb-11 7:59am
View
Browsers do not have access to such data.
You could write an ActivX control to do that.
sjelen
21-Feb-11 6:04am
View
I've updated solution with IIS configuration details you could try.
sjelen
18-Feb-11 10:35am
View
Deleted
Not a complete solution:
'unload' event fires every time user navigates to another page, and to do that he doesn't need to click anywhere on <body>
He could use 'Back' or 'Forward' buttons or enter address manually.
sjelen
18-Jan-11 5:50am
View
Do you mean the name of the server from which email came from or the server you should send email to?
sjelen
30-Dec-10 8:55am
View
Do you mean public static internet IP of your modem or LAN static IP of your modem?
In first case, look at second part of "Answer 2" - that's probably the easiest way.
sjelen
23-Dec-10 8:57am
View
Correct about ViewState, this also applies to anything using encryption (like EventValidation).
However MachineKey does not have anything to do with Session. Setting up session in a web farm is complete different problem (you can not use in-proc sessions).
sjelen
23-Dec-10 8:39am
View
You have a typo: 'A-z' instead 'A-Z'.
I would add marking of first and last char in word (\b):
(\b[a-zA-Z]+\d{5}[xyz]\b)
sjelen
30-Nov-10 11:11am
View
why create Color instance from bytes, then convert color components to strings, just to convert those strings back into bytes?
sjelen
30-Nov-10 11:08am
View
Right,
You can not use GetPixel() after you call LockBits() on same bitmap. That's why you get memory errors.
sjelen
30-Nov-10 8:28am
View
Deleted
Reason for my vote of 4
Good tip. But why using explicitly Form1 in ScriptManager? It woulg be more general (and made more sense) if you used an interface instead.
sjelen
30-Nov-10 7:52am
View
Deleted
Reason for my vote of 5
Good tip. What are the necessary user privileges to execute this code?
Show More