|
dataGridView18
textBox63
Oh dear, oh dear, oh dear...
That implies that your one form as at least 18 data grids, and 63 text boxes. Tell me, would you like to sit down in front of that and use it every day? Why not? Because you can't find anything you are looking for? I certainly couldn't... Break it up, show a limited number of controls, and don't flood the user with info: it just confuses people.
Secondly, please stop using VS default names for controls. You may remember today what textBox47 contains, but will you in 3 months time when you have to maintain this? Use sensible names that describe the purpose of the control: it makes your code more self documenting, easier to read, and more reliable.
And third, what makes you think you have put a value in the textbox? The only code you show that refers to it will only do anything at all when the selection of the right datagridview changes. Did you use the debugger to check that the code was executed?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
the code is running because when i run the program with f5 textbox63 shows C:\Users\Master of Disaster\Pictures\wendy\beeldschoon.png. the point is i putted the location of an image into a database so that when i canged the picturebox and closed the application the settings are still saved when i re-open the application
|
|
|
|
|
Then you need to show us any code that actually does that, because the code you show certainly doesn't!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
THNXX!! it works now !! the problem seems to be that the tabpage wasn't vissible.
|
|
|
|
|
Hello,
I have html source code of a page from that source code i want to make signup windows application in c#
Source :
<!DOCTYPE html><!-- this MUST be first line -->
<html>
<head>
<title>MAD</title>
</head>
<body>
<form action='http://register.abc.com/register' method='post' id='cI' enctype='text/plain'>
<!-- hidden fields: -->
<input name='s' value="" type='hidden'/>
<input name='did' value='MIDP' type='hidden'/>
<input name='pid' value='abc' type='hidden'/>
<input name='cid' value='abc' type='hidden'/>
<input name='l' value='en' type='hidden'/>
<!-- visible fields: -->
<p>
<b>USERNAME</b><br>
<input name='un' value=''/>
</p><p>
<b>PASSWORD</b><br>
<input name='pw' value='password'/>
</p><p>
<img id="CAPTCHA" src="" /> <input type="button" id="regen" value="REFRESH CAPTCHA" />
</p><p>
<b>CAPTCHA</b><br/>
<input name='c' >
<br/><br/>
<input name='send' value=' CREATE ' type='submit'>
</p>
</form>
<script type="text/javascript">
var dids = ["MIDP","ANDROID","WINDOWS","BlackBerry","SYMBIAN","MAC","WP","LINUX","IPHONE","WM"];
var curdid = 0;
function createCaptcha()
{
var chars ="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ"
+ "abcdefghiklmnopqrstuvwxyz";
var str = "";
for (var i=0; i<10; i++)
{
str += chars[ Math.floor( Math.random() * chars.length ) ];
}
var form = document.getElementById("cI");
form.s.value = str;
document.getElementById("CAPTCHA").src =
'http://register.abc.com/init?w=120&h=40&f=png&s=' + str;
form.did.value = dids[curdid];
curdid = ( curdid + 1 ) % dids.length;
}
// generate initial CAPTCHA strings:
createCaptcha( );
document.getElementById("regen").onclick = createCaptcha;
</script>
</body>
</html>
I must do parse html in c# i think ?
I dont know actually how to start
Please help ...
|
|
|
|
|
Member 11413612 wrote: I must do parse html in c# i think ?
No, that would be a very odd way to do things.
Just because you have found a solution on the internet, doesn't mean it's the right solution: and HTML / Javascript code for a website (especially as poor as that is) does not translate well into a WinForms or WPF application. That's like assuming that the first car door you find when you walk into a car breakers will do to replace the front door of your house!
Stop, sit down, look at your task, and try to work out what to do for yourself instead of hunting for a "quick fix" for your homework on the internet. It really will be a lot easier!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Are you writing a Windows Forms or a WPF application? What you are looking at writing is normally called a Login dialog, so you need to search for a Login dialog using the appropriate technology (e.g., google for wpf login dialog).
|
|
|
|
|
Hi friends,
i need to know if any possibilities to get controls like drag and drop and form creation and fields must be created regarding the controls created by user.
and storing retrieving values from database is that possible if any other ideas about this project link reference pls guide me
|
|
|
|
|
Muthuraj.M wrote: pls guide me
If I had any idea what help you were asking for, I probably would...
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Edit your question and provide better information - don't try to be terse and save words: the better your question, the better the help we can give.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Muthuraj.M wrote: storing retrieving values from database is that possible The world would be in a mess if it wasn't.
|
|
|
|
|
Hello to everyone,
Maybe anyone can help me...
The szenario looks like this...
There is a Mobile Device with Windows CE, a WCF Service hosted in IIS on Desktop PC and a Sybase Database hosted on a different Server.
I have to connect the WCF form the Mobile Device and get the Data from the Database.
If i test it from localhost (ASP.NET Development Server) everythink works fine, and i recive the data from the Database. If i connect remotely i can also connect the WCF Service but if i try to connect the Database the client app throws a systemerror and i don't know why
Maybe a problem in the web.config I am greatful for any hint
<xml version="1.0"?>
<!--
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings/>
<connectionStrings/>
<system.web>
<!--
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
<!--
<authentication mode="Windows"/>
<!--
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<!--
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
</system.webServer>
<system.serviceModel>
<services>
<service behaviorConfiguration="BooksServices.Service1Behavior" name="BooksServices.BooksService">
<endpoint address="" binding="basicHttpBinding" contract="BooksServices.IBooksService">
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://192.168.178.30:50501/BooksService.svc"/>
</baseAddresses>
</host>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="BooksServices.Service1Behavior">
<!--
<serviceMetadata httpGetEnabled="true"/>
<!--
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
modified 19-Feb-15 2:21am.
|
|
|
|
|
Hello again!
I have an issue regarding a search function for a datagridview to my MySQL DB.
The code is the following:
DataView DV = new DataView(dbDataSet);
DV.RowFilter = string.Format("Name LIKE '%{0}'", textBox1.Text);
dataGridView1.DataSource = DV;
Now the search kind-of works, but it only displays the data if the name I search for is completely written out.
For example, if I want to search for "John", I need to write "John", or else it will not show anything.
What am I doing wrong?
modified 19-Feb-15 10:54am.
|
|
|
|
|
I don't know about MySQL, it has been a while since I used it. MSSQL would require the Like statement Like this:
Select * From SomeTable Where Name Like '%John%'
This would return anything where John is in the middle of the string. Your example would return data where John is at the end of the string.
HTH
Jack of all trades, master of none, though often times better than master of one.
|
|
|
|
|
Thank you very much! Appears I needed another % symbol at the end of the {0}.
Works flawlessly now.
|
|
|
|
|
j'ai essayé de faire un dataGridView pour visualiser des données a partir d'une database Oracle
voici mon essai : le datagrid est vide mon table contient 7 champs et il est rempli par 6 lignes
private void LoadGrid()
{
selection sel = new selection();
sel.ExecuteSql("select * from fournisseur");
sel.getDr();
if (sel.getDr().HasRows)
{
while (sel.getDr().Read())
{
dataGridView1.Rows.Add(sel.getDr()[2].ToString(), sel.getDr()[4].ToString(), sel.getDr()[5].ToString(), sel.getDr()[6].ToString());
}
}
}
et voici la classe de connexion
sing System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Oracle.DataAccess.Client;
namespace Gestion_Budgétaire
{
public class Connexion
{
protected String cs="Data source=XE;User Id=system; Password=12345;";
protected OracleConnection conn;
protected OracleCommand cmd;
public void ouvrir()
{
try
{
conn = new OracleConnection();
conn.ConnectionString = cs;
conn.Open();
}
catch (Exception ex)
{
MessageBox.Show("Error Fatal!" + ex.Message);
}
}
public void close()
{
try
{
conn.Close();
MessageBox.Show("disconnected");
}
catch (Exception ex)
{
MessageBox.Show("Echec!" + ex.Message);
}
}
}
public class selection
: Connexion
{
private OracleDataReader dr;
public OracleDataReader getDr()
{
return dr;
}
public void ExecuteSql(String re)
{
ouvrir();
try
{
cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = re;
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
public class mettre_a_jour
: Connexion
{
public void update(String reqSql)
{
ouvrir();
try
{
cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = reqSql;
cmd.ExecuteNonQuery();
MessageBox.Show("DataBase Updated");
}
catch(Exception ex)
{
MessageBox.Show("error fatal" + ex.Message);
}
}
}
} SVP aidez moi
|
|
|
|
|
|
I'm pulling in images from a camera at around 300 frames a second and i'm stitching them together. I'm not even close to being able to keep up with the camera currently. I was hoping I could get some of the experts here at CodeProject to review my code and point out anyways to make the process faster.
Thanks
Bitmap currentStitch = null;
private void StitchImage(object sender)
{
for (int i = 0; i < FrameList.Count; i++)
{
if (currentStitch == null) currentStitch = (Bitmap)FrameList[i].Clone();
else
AddCurretnSlice(FrameList[i]);
}
}
private void AddCurretnSlice(Bitmap Slice)
{
Bitmap newStitch = new Bitmap(currentStitch.Width + Slice.Width, Slice.Height);
BitmapData destinationData = newStitch.LockBits(new Rectangle(0, 0, newStitch.Width, newStitch.Height), ImageLockMode.ReadWrite, currentStitch.PixelFormat);
BitmapData overlayData = currentStitch.LockBits(new Rectangle(0, 0, currentStitch.Width, currentStitch.Height), ImageLockMode.ReadOnly, currentStitch.PixelFormat);
BitmapData sourceData = Slice.LockBits(new Rectangle(0, 0, Slice.Width, Slice.Height), ImageLockMode.ReadOnly, Slice.PixelFormat);
try
{
int dstHeight = destinationData.Height;
int src1Height = overlayData.Height;
int src2Height = sourceData.Height;
int src1Stride = overlayData.Stride;
int src2Stride = sourceData.Stride;
int dstStride = destinationData.Stride;
int pixelSize = System.Drawing.Image.GetPixelFormatSize(sourceData.PixelFormat) / 8;
int copySize1 = overlayData.Width * pixelSize;
int copySize2 = sourceData.Width * pixelSize;
unsafe
{
byte* src1 = (byte*)overlayData.Scan0.ToPointer();
byte* src2 = (byte*)sourceData.Scan0.ToPointer();
byte* dst = (byte*)destinationData.Scan0.ToPointer();
for (int y = 0; y < dstHeight; y++)
{
if (y < src1Height)
AVision.SystemTools.CopyUnmanagedMemory(dst, src1, copySize1);
if (y < src2Height)
AVision.SystemTools.CopyUnmanagedMemory(dst + copySize1, src2, copySize2);
src1 += src1Stride;
src2 += src2Stride;
dst += dstStride;
}
}
}
finally
{
newStitch.UnlockBits(destinationData);
currentStitch.UnlockBits(overlayData);
Slice.UnlockBits(sourceData);
currentStitch.Dispose();
currentStitch = newStitch;
}
}
|
|
|
|
|
IMHO, you're better off saving the images to disk and stitching them in a separate thread (or even process).
/ravi
|
|
|
|
|
Thanks for the response, but that's not possible. The requirement is to keep up with the camera in real time.
|
|
|
|
|
The requirement is not technically possible under Windows. It is not a real-time system, and the OS may decide to freeze your threads when it sees fit. I'd also like to point out that 300 bitmaps/second would be a bit "much". How big is a single image? And how many seconds worth of those bitmaps would fit into the available memory?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks for your reply, but I don't believe it's not possible. I'm up to processing a little over 200/second and I've never heard of the OS deciding to freeze my thread on it's own when it sees fit. Sounds like somebody might be used to blaming windows for shody code.
These bitmaps are from a line-scan camera, which means they are at most 10 pixels across. This has to be doable. I've got it dumping to an array now and another thread picking images up from that array. This works, but my stitch is a few seconds behind my camera when a record event fires. I believe i can get it to real time.
|
|
|
|
|
JBHowl wrote: Sounds like somebody might be used to blaming windows for shody code. Now, I don't want to split the thread into fibers, but..
http://en.wikipedia.org/wiki/Preemption_(computing)[^]
JBHowl wrote: This works, but my stitch is a few seconds behind my camera when a record event
fires. I believe i can get it to real time. You can push your computer to its limits, that is true. It will depend on your defenition of "real time", as Windows is no such OS, but still very powerfull - even without writing a new dedicated device-driver in an unmanaged language.
Can you store the "last" picture in a different place, and use that as a source for painting the display? A memory-mapped file might help - any fixed-size memory buffer that does not move around in memory would do.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Instead of re-allocating memory for every "slice", I would look into pre-allocating enough memory for a "graphics" object that can hold all expected slices, and then overlaying / merging this with the slices; cropping the final result if necessary.
(see: Graphics class; FromImage() and DrawImage()).
Easy enough to benchmark without the camera (and third-party software).
|
|
|
|
|
Hey Gerry, thanks! That's exactly what I did and it works great except every now and then I run out of memory allocating my blank bitmap. You have to have enough continuous memory available and sometimes it errors out. See below, any thoughts?
bmp = new Bitmap(100000, FrameHeight, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
bmpG = Graphics.FromImage(bmp);
private void frameevent_newFrame(bitmap frame)
{
}
any ideas?
|
|
|
|
|
"Bitmap" is an IDisposable.
When working with "images" (or any IDisposable), particularly a lot of them, you need to insure that they are disposed of in a timely manner; e.g.
using ( Bitmap bmp = new Bitmap ... ) {
:
:
}
|
|
|
|
|