|
nstk wrote: , in Entity Framework we create the backend from which the classes for our frontend code derive
Not necessarily: it is possible to start with the object model and generate the database tables from it.
nstk wrote: Does this mean that we don't need any thoughts about classes building anymore?
Doesn't this make at least a part of OOP thinking and of UML useless?
We still need to think about the OO design: the Entity Classes are still classes and still need to be designed properly. All the EF does is handle how the object it stored.
It is also perfectly possible to write OO code without UML, even so the classes generated can be described in UML, otherwise there is something seriously wrong with the framework.
|
|
|
|
|
Hi, can I set the value of a textbox in a webpage from a windows application in my computer? For example, www.aaa.com there is a textbox (I know its variable name and it is constant) when I focus on that textbox, my windows application will appear. I will choose a text from a listbox and it will write the value to the target textbox?? Thanks.
|
|
|
|
|
Why would you want to do this from a "windows" application (.NET ?): are you attempting to modify somebody else's website ?
If you wrote the HTML, implement the solution in HTML which should be pretty simple: implement a way to make a List appear, catch the user's click on an item it, and so forth.
best, Bill
"The first principle is that you must not fool yourself, and you are the easiest person to fool." Richard Feynman
|
|
|
|
|
I want to do this because, the I don't have a chance to change the web site and I don't want to make changes on the site. For instance, I am working for an IT support of a company, we have a site that workers ask questions and we answer them. I have some constant answers so, when I focus on a textbox that for the answer, my form will appear and I will choose the constant answer for that question finally I'll send it. Thanks for the answer.
|
|
|
|
|
|
Read the posting guidelines!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Well, you could always hold up a dictaphone to the earpiece.
|
|
|
|
|
I need help to create a phone dialer in c # with multiple lines
|
|
|
|
|
Yes. It will certainly take multiple lines (of c#).
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
If you needed help with something, why didn't you ask a question about what it is you needed help with??
|
|
|
|
|
I need to create Dialer using C# with 5 Data Modems, it`s code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Management;
using System.IO.Ports;
using System.Threading;
namespace ConsoleApplication4
{
class Program
{
[STAThread]
static void Main()
{
int Numero;
Numero = 37924300;
string classname = "Win32_POTSModem";
string strMachine = ".";
System.Management.ObjectQuery oQuery;
System.Management.ManagementScope oScope;
System.Management.ManagementObjectSearcher oSearcher;
string strSQL;
try
{
strSQL = "Select * from " + classname;
oQuery = new ObjectQuery(strSQL);
oScope = new ManagementScope(@"\\" + strMachine + @"\root\cimv2");
oSearcher = new ManagementObjectSearcher(oScope, oQuery);
foreach (ManagementObject oService in oSearcher.Get())
{
if (!oService.GetPropertyValue("DeviceID").ToString().Contains("Modem"))
{
Console.WriteLine(oService.GetPropertyValue("AttachedTo"));
Console.WriteLine(oService.GetPropertyValue("Name"));
Console.WriteLine(oService.GetPropertyValue("DeviceID"));
SerialPort modem1 = new SerialPort(oService.GetPropertyValue("AttachedTo").ToString(), 9600, Parity.None, 8, StopBits.One);
Console.Write("Try call on modem " + oService.GetPropertyValue("Name").ToString());
while (modem1.IsOpen)
{
modem1.Close();
Thread.Sleep(1000);
}
modem1.Open();
modem1.NewLine = "\n";
Console.WriteLine(modem1.ToString());
Console.WriteLine(modem1.PortName);
Console.WriteLine(modem1.NewLine.ToString());
Console.WriteLine(modem1.IsOpen.ToString());
Console.WriteLine(modem1.ReadExisting());
modem1.Open();
modem1.ReadTimeout = 100000;
modem1.NewLine = "\r";
modem1.WriteLine("ATZ");
Console.Write("reset the modem");
modem1.ReadTo("OK\r\n");
Console.Write("wait for OK from modem");
modem1.WriteLine("ATHDT " + Numero + "@1@1@1@1@1@1@1@1@1@1@1@1@1@1@1@1@1@1@1@1@1@1@1@1@1@1@1@1@1");
Console.Write("Discando para o numero " + Numero);
string response = modem1.ReadTo("\r").Trim();
Console.Write("Read status modem " + response);
int i = 0;
while (i < 900000)
{
Console.WriteLine(modem1.ReadExisting());
i++;
}
modem1.Close();
Console.WriteLine();
Console.Write("Disconnect call " + modem1.PortName);
Console.ReadKey();
}
}
Console.WriteLine("Write call number");
Console.ReadKey();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.ReadKey();
}
}
}
}
|
|
|
|
|
5 seperate lines, huh?? this code is never going to work.
I could descrbie how to rip all this out and convert it to it's own class so you could run multiple instances of it on seperate threads, but it would take FAR more than a few forum posts to do so. That's just not going to happen.
There's no way you're going to get this code to work with any efficiency at all.
|
|
|
|
|
I have a problem with the validation using Enterprise Library 5.0 & the integration with Window Presentation Foundation (WPF). I can't validate the enter of a string. I try with WindowForm and I have the results but with WPF is so impossible.
If exist any example in validation with EntLib & WPF using VS 2010. Please send me right here or at the email jhcastellanos@uci.cu
|
|
|
|
|
Hi all,
i'm looking for a possibilty, to fill/paint the Background of different classes / objects with one Method. My code / thoughts so far:
private void LangSelectWindow_Paint(object sender, PaintEventArgs e)
{
PaintForm(this, e, "#E4A458", "#F0D697", 90f);
}
private void PaintForm(Form sender, PaintEventArgs e, String Color1, String Color2, float Angle)
{
Graphics g = e.Graphics;
Rectangle rBackground = new Rectangle(0, 0,
sender.Width, sender.Height);
System.Drawing.Drawing2D.LinearGradientBrush bBackground
= new System.Drawing.Drawing2D.LinearGradientBrush(rBackground,
System.Drawing.ColorTranslator.FromHtml(Color1),
System.Drawing.ColorTranslator.FromHtml(Color2),
Angle);
g.FillRectangle(bBackground, rBackground);
bBackground.Dispose();
}
works like a charm. But if i have a label or other object, do i have to create a new "PaintForm" for everything ? i.e.
private void LangSelectWindow_Paint(object sender, PaintEventArgs e)
{
PaintLabel(this, e, "#E4A458", "#F0D697", 90f);
}
private void PaintLabel(Label sender, PaintEventArgs e, String Color1, String Color2, float Angle)
{
Graphics g = e.Graphics;
Rectangle rBackground = new Rectangle(0, 0,
sender.Width, sender.Height);
System.Drawing.Drawing2D.LinearGradientBrush bBackground
= new System.Drawing.Drawing2D.LinearGradientBrush(rBackground,
System.Drawing.ColorTranslator.FromHtml(Color1),
System.Drawing.ColorTranslator.FromHtml(Color2),
Angle);
g.FillRectangle(bBackground, rBackground);
bBackground.Dispose();
}
don't want do create a single "paint-method" for every object / class. Only the BOLD marked things changes...
Tom
modified 15-Feb-12 15:08pm.
|
|
|
|
|
You could do something like:
private void PaintControl(Control sender, PaintEventArgs e, String Color1, String Color2, float Angle)
{
Graphics g = sender.CreateGraphics();
}
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Not sure I understand what it really is you are aiming for, however I would consider:
1. replacing PaintForm(Form sender, ... by PaintForm(Control sender, ...
2. wiring LangSelectWindow_Paint() to every Control's Paint event where relevant.
I also would create bBackground only once, and keep it alive in a class member.
|
|
|
|
|
Setting the background colour to Transparent on all but the base form should help you.
|
|
|
|
|
I am trying to use the SQLCommandBuilder to auto-generate the insert command, but I am getting is null. Please tell me what I am doing wrong. I have tried to use just a datatable and a dataset and neither has worked. I am starting with a table that has no records and then copying another table to it. I have tested the table copy and I know that it works. Here is my code:
private void CopyData(DataTable table, string tablename)
{
SqlDataAdapter da = new SqlDataAdapter("select * from " + tablename, cLocalConnect);
SqlCommandBuilder cBuilder = new SqlCommandBuilder(da);
DataSet ds = new DataSet();
DataTable dt = new DataTable("table1");
ds.Tables.Add(dt);
da.Fill(ds, "table1");
dt = table.Copy();
da.Update(ds);
}
|
|
|
|
|
kruegs35 wrote: but I am getting is null.
Which means what exactly?
Are you getting null reference exception?
Are you getting a null entry in the database?
This last is maybe what you meant. Since you don't have any column data it would of course be null.
|
|
|
|
|
Could it be, that you forget the Call to cBuilder ? Maybe try this:
private void CopyData(DataTable table, string tablename)
{
SqlDataAdapter da = new SqlDataAdapter("select * from " + tablename, cLocalConnect);
SqlCommandBuilder cBuilder = new SqlCommandBuilder(da);
DataSet ds = new DataSet();
DataTable dt = new DataTable("table1");
ds.Tables.Add(dt);
da.Fill(ds, "table1");
dt = table.Copy();
cBuilder.GetUpdateCommand();
da.Update(ds);
}
|
|
|
|
|
What I meant by the null, is the Insert, Update, & Delete commands are null for the data adapter. I called the GetUpdateCommand as Thomas suggested and I got an error:
Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.
My table that I am trying to update is completely empty, which I guess is the problem.
|
|
|
|
|
kruegs35 wrote: that does not return any key column information
It's even telling you what the problem is. Include the primary key in your select statement.
|
|
|
|
|
I am using SqlBulkCopy to get what I need now.
|
|
|
|
|
how can add crystal report with web application with asp.net,C# with the help of procedure
|
|
|
|
|
There[^] you go. The 4th link looks particularly promising.
|
|
|
|