|
|
On a server I have Excel 10 installed. what do I need to change in my connection in order to use it?
|
|
|
|
|
|
Microsoft Office Professional Plus 2010
|
|
|
|
|
Then you need to install the ACE driver as suggested earlier.
|
|
|
|
|
|
For Example :
From Date : 01.01.2016 to Date : 29.02.2016.This is two month date value. my problem is how to lock one month Dates between value only.
I need value is
From Date : 01.01.2016 to Date : 31.01.2016. Jan Only.So, how to lock the dates in text box?
|
|
|
|
|
Set the ReadOnly property of the TextBoxes to True?
You're question is really vague so we really don't know what you're talking about.
|
|
|
|
|
If you're looking to clamp the date range to be single month values, a simple extension method will return the last date of a month from the start date:
public static DateTime ToLastDayInMonth(this DateTime date)
{
return new DateTime(date.Year, date.Month, DateTime.DaysInMonth(date.Year, date.Month));
}
This space for rent
|
|
|
|
|
- Use a Spinner with a Minimum and Maximimum
- Use a Slider with a Minumum and Maximum
- Use a DatePicker with a Start and End date
- Use a Calendar control with a Start and End date
- ditch the textbox in this case
|
|
|
|
|
i am trying to get an sqlite project c# wpf application working with entity framework so that when i start my application and the sqlite file is missing it would create it. and the schema would come from the context just like entity framework codefirst
this is what i got so far:
my app.config
="1.0"="utf-8"
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite.EF6" />
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
<remove invariant="System.Data.SQLite" />
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
</DbProviderFactories>
</system.data>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
<provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
</providers>
</entityFramework>
</configuration>
the following is my code for the entity and context. and how i initiate them:(i got them from reading tutorials)
class ChinookContext : DbContext
{
public DbSet Artists { get; set; }
public DbSet Albums { get; set; }
public ChinookContext(string filename)
: base(new SQLiteConnection()
{
ConnectionString =
new SQLiteConnectionStringBuilder() { DataSource = filename, ForeignKeys = true }
.ConnectionString
}, true)
{
}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Conventions
.Remove();
}
}
public class Artist
{
public Artist()
{
Albums = new List();
}
public long ArtistId { get; set; }
public string Name { get; set; }
public virtual ICollection Albums { get; set; }
}
public class Album
{
public long AlbumId { get; set; }
public string Title { get; set; }
public long ArtistId { get; set; }
public virtual Artist Artist { get; set; }
}
the problem with this code is that it keep having the error:
{"SQL logic error or missing database\r\nno such table: Artist"}
and the sqlite file is not being created as well.
does anyone know why and be so kind as to show me how to resolve this?
|
|
|
|
|
I only have very little experience with EF but I think it should look like this in ChinookContext:
public DbSet<Artist> Artists { get; set; }
public DbSet<Album> Albums { get; set; }
Otherwise those properties would have nothing to do with Artist and Album except the plural form of the names
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
In your ChinookContext class, remove the line you have in the OnModelCreating method. You don't need it.
Also, your DbSet lines are bad. They should be:
public DbSet<Artist> Artists { get; set; }
public DbSet<Albums> Albums { get; set; }
I HIGHLY suggest you don't take all of your information on EF from "some tutorial on the web" because you're missing a SH*T TON of information that these tutorials are not tell you. Pick up this book[^]. It's an older book, covering EF4, but it's better than the newer books out there that were released last year.
|
|
|
|
|
please write acode that help me to develop teaching system for kids using java programming language.it include gui.if any one u have any code regarding that send me please.thanks
|
|
|
|
|
No. This isn't rentacoder - if you want something writing then you write it yourself. Also, this is the .NET forum, which has absolutely nothing to do with Java. I suggest, if you're going to try and pretend you know how to code, you learn the basics.
This space for rent
|
|
|
|
|
Greetings to all,
my application runs in a Windows Embedded Compact 7 device and it uses Compact Framework 3.5.
It establishes a TCP connection to a PLC and exchanges data with it.
I open the connection in this way:
mTcpCli = new TcpClient()
mTcpCli.Connect(mIp, mPort);
MBStream = mTcpCli.GetStream();
Then I start the communication thread.
If there is a communication error, I close the connection and I re-open it with the above code.
To close the connection I do ALL this:
MBStream.Close();
MBStream.Dispose();
mTcpCli.Client.Close();
mTcpCli.Close();
((IDisposable)mTcpCli).Dispose();
if (mTcpCli != null)
{
mTcpCli = null;
}
but it seems not to be enough...
Suppose the communication error is cable disconnected, absolutely no way to communicate.
When I re-open the connection the instruction:
mTcpCli.Connect(mIp, mPort);
should give an exception (SocketException) but it doesn't.
Until the communication is interrupted, I could say that it is not a very serious problem because the application tries to communicate with the PLC, it fails and the "close-reopen connection" loop restart (with 10 seconds of pause between one retries).
The true problem is when the communication error is solved: I re-connect the cable.
In this situation the instruction:
mTcpCli.Connect(mIp, mPort);
doesn't give any exception, and should not, but it doesn't establish a connection so the application tries to communicate with the PLC, it fails and retries the connection.
I takes 4-5 attempts to establish a TRUE connection, almost a minute.
I looked for a solution in this and other forum and in MSDN and I found that there is a bug in the TcpClient Close method but the soution, close also the network stream, doesn't work.
I tried to close and dispose all I could with no result.
When I close the connection I need to be sure it is closed and I can't succesfully open it when the cable is disconnected!
Anybody can help me?
Thank you in advance.
Steve
|
|
|
|
|
|
Thank you Richard.
I have modified the code to open the connection in this way:
LingerOption lingerOption = new LingerOption(true, 0);
mTcpCli = new TcpClient();
mTcpCli.LingerState = lingerOption;
mTcpCli.Connect(mIp, mPort);
Unfortunately nothing has changed.
|
|
|
|
|
Sorry, that's the only feature I have ever found that helps in these cases. However, it is possible that the problem lies at the other end of the connection.
|
|
|
|
|
You've tried to help me, I can only thank you even if I have not solved the problem!!
...and now I've learned one more thing!
I don't think that the problem is at the other end of the connection, ie at the PLC, for two reasons: 1- I have disconnected the cable so the PLC can do nothing; 2- there is another touch panel connected to the PLC, a standard HMI, and it works fine with disconnections and re-connections so the PLC seems to behave in the right way.
|
|
|
|
|
Any idea to limit the application google Chrome on Windows?
|
|
|
|
|
|
|
How do you want to limit it? Elaborate more on your objective so people can have a better idea of what you are trying to do?
Limit bandwidth? Limit functionality?
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
bandwidth limit to 0.5 mbps
|
|
|
|