16,022,362 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 .NET 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 snake1 (Top 51 by date)
snake1
5-Jan-13 12:57pm
View
i have checked System.Windows.Forms.WebBrowser it's the same, it connects through my default public ip address not through the vpn, the other browsers send requests through the vpn, i need to find a way to navigate my browser and send requests through vpn, if someone got any answer for this i would be appreciated.
snake1
19-Jul-12 4:02am
View
this code is for uploading file Asynchronously is it available for downloading file Asynchronously?
snake1
18-Jul-12 14:44pm
View
the exception is thrown when the file which is 12MB or more is completely downloaded
snake1
18-Jul-12 14:43pm
View
Thanks for your solution , but i'm still stucked at the same issue
i tried your code and i get the same exception , the problem is i'm able to download 1 - 5MB but when i try to download a 12MB file i get this exception when the file is downloaded and after throwing exception if i close streams or stop debugging the file is downloaded correctly
WebException : The underlying connection was closed: An unexpected error occurred on a receive.
while (intSt > 0) loop
i think the exception has been thrown at this line :
sourceStream.Read(bit, 0, bit.Length);
snake1
15-Jul-12 1:24am
View
Deleted
thanks for you response , any solutions ?
snake1
20-Jun-12 22:00pm
View
are there any solutions ?
snake1
20-Jun-12 6:52am
View
i think this issue is not because of using webclient,threads it's happening even if i use ftpwebrequest and also it happens while using download tools
snake1
20-Jun-12 6:48am
View
the file is not corrupted but i don't know if the server disconnects due to delay , the first 2 files are 2MB and the third is 13MB it's not that big
snake1
20-Jun-12 6:43am
View
thanks for your reply , i switched to ftpwebrequest and it also works fine on the first 2 files but on the third file it caught an exception "The underlying connection was closed: An unexpected error occurred on a receive." i tried to download this file with download tools again it cannot be downloaded without resuming the download it disconnects on 96% - 99% i dunno why
snake1
27-Oct-11 7:20am
View
hello Bala Selvanayagam , Thanks for your reply, it seems in your code that you are creating a new instance of a datatable how could i do that for the table which i have created into dataset ? ,because i have databinding to the members of this table
snake1
20-Aug-11 3:18am
View
Insert Step
//---------------
MemoryStream ms = new MemoryStream();
PBoxGuestImage.Image.Save(ms, ImageFormat.Jpeg);
Byte[] PicArray = new Byte[ms.Length];
ms.Position = 0;
ms.Read(PicArray, 0, PicArray.Length);
CMD.CommandText = "Insert Into TestTable(TestImage) Values (@ParTestImage)"
CMD.Parameters.AddWithValue("@ParTestImage", PicArray);
//---------------
this works great
Retrieve Step
Image NewImage;
byte[] content = (byte[])TestReader["TestImage"];
TestPictureBox.Image = null;
using (MemoryStream stream = new MemoryStream(content, 0, content.Length))
{
stream.Write(content, 0, content.Length);
NewImage = Image.FromStream(stream, true); //at this line i get the exception
}
TestPictureBox.Image = NewImage;
snake1
19-Aug-11 22:54pm
View
can u make your own insert and retrieve code and if it works for u ,help me with it
snake1
19-Aug-11 16:56pm
View
so what should i do in this case is it impossible to do that ?!,some people says it's very easy i knew it's very easy ,but why am i stuck here ?,please help me to solve this issue
snake1
19-Aug-11 16:16pm
View
yes i have tried it and it worked on a file , so is there something wrong at the insert step ?
snake1
19-Aug-11 11:25am
View
so what should i do ?, do you have any sample of code which worked for u at this case?
snake1
4-Aug-11 19:20pm
View
i have already done this but there's an exception "The Parameter Is Not Valid" maybe i'm doing something wrong can you explain with some code please ?
snake1
3-Aug-11 14:07pm
View
is there another way to select image from database and store it into picturebox ?
snake1
3-Aug-11 13:16pm
View
i have tried this line and i get the same exception
snake1
3-Aug-11 13:15pm
View
pictureBox1.Image = System.Drawing.Image.FromStream(ms);
snake1
3-Aug-11 11:04am
View
omg, i didn't sleep well since 3-4 days , ur right it was a wrong picturebox, Thanks very much for your help
snake1
3-Aug-11 10:46am
View
it's the same thing with camera, what should i do ?
snake1
3-Aug-11 10:36am
View
what if i set the specified image at the designer,why is the picturebox.image in this case is null too?
snake1
3-Aug-11 10:22am
View
i have scanned the image and i get this error
the picturebox image is null while setting breakpoint
btw i'm using sqldatabase
snake1
3-Aug-11 9:59am
View
myPictureBox.Image.Save(ms,ImageFormat.Jpeg)
i get an exception here object reference not set
snake1
1-Aug-11 16:11pm
View
i think i have searched before posting this
snake1
18-Jul-11 16:12pm
View
it's useful and it's so amazing but the right to left is so annoying
i just want to change the direction of the columns to be right to left without any troubles , when i try to do that with your sample it's the same thing the columns invisible and visible again and some annoying things happens to me
anyway to solve this problem?
Thanks.
snake1
7-Jul-11 13:00pm
View
is there any way to install database server?
snake1
3-Jul-11 3:09am
View
where can i get MDIVWCTL.DLL?
snake1
23-Jun-11 22:38pm
View
i dun think that's gonna work , i'm doing an operation every 1 minute,i want the program to execute the method 1 time every minute but the timer execute it 2 times every 1 minute
snake1
22-Jun-11 21:10pm
View
thanks very much for your answer it works now but after changing little thing
InsertCMD.CommandText = "insert into Test(TestDateTime) values ( CONVERT([datetime], '@GDDate', 121) )";
'@GDDate' should be @GDDate
snake1
22-Jun-11 20:39pm
View
yeah, it's the same error
snake1
22-Jun-11 19:24pm
View
thanks for your answer , but it doesn't work for me
snake1
22-Jun-11 16:39pm
View
oh, sorry for that
snake1
30-Apr-11 6:43am
View
i have already created a windows service and it works good for me but i can't use timer in this case ,i want to execute a method every 1 minute but,the program execute it one time i have set the start type to Automatic so the windows service should start on windows startup but it just execute the method one time , the only way to execute the method again is to restart the service
snake1
29-Apr-11 9:19am
View
i have already posted a new question but i didn't think that i found the solution , can u help me there?
snake1
29-Apr-11 6:22am
View
i'm doing a closing day method that's why i want to do this
snake1
29-Apr-11 2:23am
View
hello Henry Minute , was just wondering how to do a method in a specific time and that time is stored in a variable , and the variable gets the specific time from database so the user can write the specific time in database if it's compare to the windows time the program automatically should do the method
and is it possible to make this method while the program is not running i mean something like in process service or windows service
snake1
7-Apr-11 9:44am
View
i tried to use sqldatareader is it possible to use foreach statement ?
snake1
7-Apr-11 0:58am
View
foreach(datarow row in this.dataset.tables[TableName].rows)
{
//----------------
}
is there anyway to retrieve the table without dataset? i mean can i directly retrieve the table from sql database? , because the dataset is too slowly
snake1
7-Apr-11 0:58am
View
Deleted
foreach(datarow row in this.dataset.Tables[TableName].rows)
{
//----------------
}
is there anyway to retrieve the table without dataset? i mean can i directly retrieve the table from sql database?
snake1
2-Apr-11 23:19pm
View
hello henry, thanks very much for the help
i have RoomType this table got 2 columns called [RoomTyCode - RoomTyName]
the primary is RoomTyCode table and i have a foreign key in Room table called ROMRoomType
how to retrieve the RoomTyName Value as ROMRoomType
if the ROMRoomType = 1 so it's gonna retrieve the 1st RoomTyName Value and its Name Villa
snake1
2-Apr-11 11:55am
View
uhmm it's ok now i have tried to use fn as string and it works now
snake1
2-Apr-11 11:47am
View
int fn = C3["FloorNumber"];
this line is has an error "Cannot Implicitly Convert Type Object To Int" and i tried to convert it that way
int fn = (int)C3["FloorNumber"];
so i get an exception , so the buttons won't appear
snake1
2-Apr-11 9:16am
View
All of the buttons use the same event handler for their Click event
let's say i have 6 buttons retrieved by
foreach(DataRow C3 in this.dB1_PureEyezDataSet.Tables["Floor"].Rows)
{
Button B1 = new Button
//--------------
}
all of those buttons is gonna be using the same event handler
so how could i control all of them at the same event handler not to make the same thing
and how to make the button automatically gets its value
string filterExp = "Floor = 1";
i want the filterExp to automatically get the value when there's a new floor is added
let's say the user added a new floor so it's gonna appear as a button, this button is gonna do the same thing as the others
i want the filterExp to get the value automatically
is it possible or should i create a button by button ?
snake1
1-Apr-11 23:35pm
View
When the user creates a new floor, add a button
i didn't mean that he's gonna create a floor from the homescreen let's say he has created a row in database which indicates to the new floor
the floor is gonna appear as a button by the old method which i have started with look up at the question
the problem is when the button is added to the form how can i use the button click eventhandler and make it indicates to the new floor
i mean how to display the rooms which belongs to the new floor
let's say i have added 30 floor in the database
all of those rows is gonna appear as buttons in the homescreen the question is how to make those buttons works together at runtime if i select the floor number 27 is gonna get the rooms which belongs to this floor at runtime and if i select 26 the program gonna get the rooms which belongs to that floor ,etc i want the user to be able to add floors and filter the rooms at runtime not adding a code to a button by button
snake1
1-Apr-11 20:26pm
View
can u help me here or should i start a new question?
snake1
1-Apr-11 20:21pm
View
hello Henry
u already solved my problem but i'm sorry there's one thing more , please
now i have added the filterexp value i can't make it auto increment with the floors numbers because it's string
i mean i have to add filterexp value foreach button by myself and i want the user to be able to add floors and can filter them so what should i do
i'm srry but please i need your help here
snake
snake1
1-Apr-11 11:18am
View
hello Henry Minute
thanks very much for helping
snake1
1-Apr-11 10:20am
View
hello Henry Minute
Thanks very much for the help
but there's a little question here i have retrieve the rooms which belongs to the floor 1 but i can't make the status of them like i did before
explaining more:-i have just retrieved the new rooms as labels which belongs to floor number 1 but i still can't make the status if it's 1 it's gonna be limegreen if it's 2 it's gonna be Red , etc like what u have explained to me before
Hotel System Main Page
[
^
]
i can't use foreach statement in this case
sorry for this little question
but, how could i solve this?
Code:-
try
{
string filterExp = "FLOID = 1";
string sortExp = "";
DataRow[] drarray;
drarray = dB1_PureEyezDataSet.Room.Select(filterExp, sortExp, DataViewRowState.CurrentRows);
FLP1.Controls.Clear();
for (int i = 0; i < drarray.Length; i++)
{
Label B3 = new Label();
B3.Width = 104;
B3.Height = 80;
B3.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
B3.Dock = DockStyle.Fill;
B3.Anchor = AnchorStyles.None;
B3.TextAlign = System.Drawing.ContentAlignment.TopRight;
FLP1.Controls.Add(B3);
B3.BorderStyle = BorderStyle.FixedSingle;
}
}
catch { }
snake1
31-Mar-11 7:50am
View
hello
i think u didn't get it i want the user to be able to add floors to the hotel also if the floor is added ,it will appear as button shape if he clicked on that button the rooms which belongs to this floor is gonna be appear on the main screen as labels
snake1
29-Mar-11 7:48am
View
oh i'm sorry i added the comment as a solution sorry for that
firstly thanks for ur attention
here's my new code after editing some errors
Collapse
private void FE_Method1()
{
foreach (DataRow C2 in dB1_PureEyezDataSet.Room.Rows)
{
try
{
Label B1 = new Label();
B1.BackColor = Color.LimeGreen;
B1.Width = 104;
B1.Height = 100;
B1.Dock = DockStyle.Fill;
B1.Anchor = AnchorStyles.None;
B1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
TLP1.Controls.Add(B1);
B1.BorderStyle = BorderStyle.FixedSingle;
B1.Text = "Test";
foreach (DataGridViewRow row in dataGridView1.Rows)
{
switch (row.Cells[9].Value.ToString())
{
case "1":
B1.BackColor = Color.LimeGreen;
break;
case "2":
B1.BackColor = Color.Red;
break;
case "3":
B1.BackColor = Color.Blue;
break;
}
}
}
catch (Exception)
{
}
}
}
TLP1 is a tablelayoutpanel
the problem is that i'm using B1 it's an object from Label class so when i try to change that object backcolor it changes all the labels
is there anyway to solve this problem ?
Show More