|
Never, ever ask about dates whilst he's online - everyone, even end users, should be forced to use ISO 8601 apparently
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
You bet. Well, not forced, per se... 
|
|
|
|
|
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Sorry, I was out. Thanks for filling in.
|
|
|
|
|
You're welcome back.
|
|
|
|
|
I have an application that uses the Enterprise Application Block 3.1. Yes I know there is an Enterprise Application Block 4.0 and 5.0 that is now available. I cannot use these applications blocks because they require the 3.5 .NET Framework. Anyway, I know that the Enterprise Application Block 3.1 uses the DbConnection class and I am curious as to which databases this supports? I could not find this anywhere in MSDN. I think some database connections require custom classes that derive from the DbConnection class but I am after a list of databases that the Enterprise Application Block 3.1 will automatically handle without the implementation of custom classes?
Chris
|
|
|
|
|
Ummm... any class that derives from DbConnection? That's the point of interfaces and abstract classes.
By using System.Data.IDbConnection and System.Data.IDbCommand my primary database class supports:
public enum SupportedDatabase
{
Access
,
Cache
,
Excel
,
FireBird
,
Ingres
,
MySql
,
ODBC
,
Oracle
,
SqlServer
,
OleSqlServer
}
And I'll add more as I find them.
|
|
|
|
|
Thanks for the response. I am so glad someone else is using this besides me. I do have another question. With the databases that you mention, none of them require attaching addition dlls? For example, MySql doesn't require you to install some sort of .NET Component Installation and then attach those .NET DLLs to your solution so a user can then use MySql? Or is that automatically included within the enterprise library like SqlServer? What about Cache?
Chris
|
|
|
|
|
Unless it uses the OleDb provider, each database needs its own provider -- but the "install" is just a copy of the DLL:
Ca.Ingres.Client.dll
FirebirdSql.Data.FirebirdClient.dll
InterSystems.Data.CacheClient.dll
MySql.Data.dll
Oracle.DataAccess.dll
|
|
|
|
|
Hi,
I want to download files Asynchronously from internet in my C# application.
I don't have any idea about Asynchronous downloading.
Can any one help me???
Thanks,
Sunil G.
modified on Saturday, April 10, 2010 4:27 PM
|
|
|
|
|
Try the WebClient class...
Chris
|
|
|
|
|
There's an example here[^]. Good luck
I are Troll
|
|
|
|
|
Hi,
I want to download 10 mb file from URL or FTP. downloading is in progress and 5MB downloaded, now i want to cancel the download. Next time the application should download remaining 5 MB.
How to do it?
Reply ASAP.
Thanking You,
Sunil G.
|
|
|
|
|
Sunil G wrote: How to do it?
Using BITS[^]. Divide the data over two zipfiles and download them.
Sunil G wrote: Reply ASAP.
Whehe, you failed to specify in which year I should reply - so I assumed "this" year
I are Troll
|
|
|
|
|
RegEdit Copy Key Name for Microsoft Office 10.0 is "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\10.0". So why is registry equal to null in "registry = Registry.LocalMachine.OpenSubKey( @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\10.0", false);" in the following C# 2008 code?
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;
namespace MSKeyFinder
{
public partial class frmMain : Form
{
private const int CS_DROPSHADOW = 0x00020000;
public frmMain()
{
InitializeComponent();
}
protected override CreateParams CreateParams
{
get
{
CreateParams p = base.CreateParams;
p.ClassStyle |= CS_DROPSHADOW;
return p;
}
}
private void Form1_Load(object sender, System.EventArgs e)
{
byte[] digitalProductId = null;
RegistryKey registry = null;
try
{
registry = Registry.LocalMachine.OpenSubKey(
@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\10.0", false);
}
catch (System.Exception ex)
{
string caption = "Error";
MessageBoxButtons buttons = MessageBoxButtons.OK;
MessageBoxIcon icon = MessageBoxIcon.Error;
MessageBox.Show(ex.Message, caption, buttons, icon);
Environment.Exit(0);
}
finally
{
if (registry == null)
{
string message = "Microsoft Office (TM) XP not installed or error\r\n" +
"reading Registry (Registry.LocalMachine.OpenSubKey returned null).";
string caption = "Error";
MessageBoxButtons buttons = MessageBoxButtons.OK;
MessageBoxIcon icon = MessageBoxIcon.Error;
MessageBox.Show(message, caption, buttons, icon);
Environment.Exit(0);
}
else
{
registry.Close();
lblOffVersion.Text = (string)"Microsoft Office (TM) 2002";
digitalProductId = registry.GetValue("DigitalProductID") as byte[];
lblOffiProductKey.Text = (string)DecodeProductKey(digitalProductId);
}
}
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
Environment.Exit(0);
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
About dlgForm1 = new About();
dlgForm1.ShowDialog();
}
public static byte[] GetRegistryDigitalProductID()
{
byte[] digitalProductId = null;
RegistryKey registry = null; ;
try
{
registry = Registry.LocalMachine.OpenSubKey(
@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\10.0\Registration\" +
@"{91110409-6000-11D3-8CFE-0050048383C9}", false);
}
catch (System.Exception ex)
{
registry.Close();
string caption = "Error";
MessageBoxButtons buttons = MessageBoxButtons.OK;
MessageBoxIcon icon = MessageBoxIcon.Error;
MessageBox.Show(ex.Message, caption, buttons, icon);
Environment.Exit(0);
}
finally
{
if (registry == null)
{
registry.Close();
string message = "Microsoft Office (TM) XP not installed or error\r\n" +
"reading Registry (Registry.LocalMachine.OpenSubKey returned null).";
string caption = "Error";
MessageBoxButtons buttons = MessageBoxButtons.OK;
MessageBoxIcon icon = MessageBoxIcon.Error;
MessageBox.Show(message, caption, buttons, icon);
Environment.Exit(0);
}
else
{
digitalProductId = registry.GetValue("DigitalProductID") as byte[];
registry.Close();
}
}
return digitalProductId;
}
public static string DecodeProductKey(byte[] digitalProductId)
{
const int keyStartIndex = 52;
const int keyEndIndex = keyStartIndex + 15;
char[] digits = new char[]
{
'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'M', 'P', 'Q', 'R',
'T', 'V', 'W', 'X', 'Y', '2', '3', '4', '6', '7', '8', '9',
};
const int decodeLength = 29;
const int decodeStringLength = 15;
char[] decodedChars = new char[decodeLength];
ArrayList hexPid = new ArrayList();
for (int i = keyStartIndex; i <= keyEndIndex; i++)
{
hexPid.Add(digitalProductId[i]);
}
for (int i = decodeLength - 1; i >= 0; i--)
{
if ((i + 1) % 6 == 0)
{
decodedChars[i] = '-';
}
else
{
int digitMapIndex = 0;
for (int j = decodeStringLength - 1; j >= 0; j--)
{
int byteValue = (digitMapIndex << 8) | (byte)hexPid[j];
hexPid[j] = (byte)(byteValue / 24);
digitMapIndex = byteValue % 24;
decodedChars[i] = digits[digitMapIndex];
}
}
}
return new string(decodedChars);
}
private void timer1_Tick(object sender, EventArgs e)
{
toolStripStatusLabel1.Text = DateTime.Now.ToShortTimeString();
}
}
}
|
|
|
|
|
Closed this question. I figured it out by myself.
|
|
|
|
|
spicture wrote: I figured it out by myself.
So you are also Member 6677969?
Why? So you can vote yourself up?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
You can't do that anyway - or at least not from the same IP address
|
|
|
|
|
Member 6677969 wrote: So why is registry equal to null
The method OpenSubKey returns NULL if the operation failed, as stated in the documentation[^]. This is probably a permission-related issue.
Why would that be? Well, simple; the only reason why someone would want to read that key is to use it on another machine.
I are Troll
|
|
|
|
|
hi, regarding to an article I've read, adding Enlist=true parameter to connection string is enough to add that connection to the pool. I've done and didn't get any errors.Is it done now? Have I implemented the pool in the right way? because I didn't realize any difference
|
|
|
|
|
teknolog123 wrote: regarding to an article I've read
Know one knows what article you are talking about - could you post a link please?
|
|
|
|
|
in fact, I didn't mean to ask you to verify the correctness of the article. Instead, is it enough to add Enlist=true pm to implement the pool
|
|
|
|
|
I expect it has no effect on ADO.NET, which always wants to use a pool anyway, but I could be wrong.
Perhaps the database forum would be a better choice.
|
|
|
|
|
teknolog123 wrote: regarding to an article I've read, adding Enlist=true parameter to connection string is enough to add that connection to the pool. I've done and didn't get any errors.Is it done now?
I'm betting 2 cents that you're not referring to an article from CodeProject
The Enlist parameter isn't going to influence connection pooling[^]. I believe that pooling is the default behaviour for all providers, with the exception of ODBC.
I are Troll
|
|
|
|
|
i m using following code to set Datasource of gridview but its not working plz help
string path = Directory.GetCurrentDirectory();
string conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + "\\cricketdb.mdb";
OleDbConnection con = new OleDbConnection(conn);
OleDbCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "SELECT * FROM countryinfo";
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
DataSet ds = new DataSet("countryinfo");
OleDbCommandBuilder oldbcbr = new OleDbCommandBuilder(da);
da.Fill(ds, "countryinfo");
dataGridView1.DataSource = ds;
comboBox2.DataSource = ds.Tables["Country_Name"];
listBox1.DataSource = ds.DefaultViewManager;
listBox1.DisplayMember = "Country_Name";
dataGridView1.DataSource = ds;
DataTable dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;
comboBox2.DataSource = dt;
Its also not setting datasource of anycontrol like combo or list plz help
|
|
|
|
|