|
If you're starting with a CSV, then rewrite your import code to create numeric columns for numeric data. Otherwise, you'll always be held back by poor database design.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks christian
I will now do that. I did wonder at the time if I was going the right way.
Stay tuned for future developments !
Curvoisier concerto is a personal favourite of mine.;)
|
|
|
|
|
You can convert your data on the fly using a cast:
select cast(columnname as int) from ...
|
|
|
|
|
I know you can handle the ItemClick event for each of the menuitems individually. Is it possible to handle all the click events for a menu using a switch statement? If so how?
Mark
|
|
|
|
|
You could assign the same Click event handler for every menu item. The sender in your event handler arguments is the menu item that was clicked, so you can create a switch statement...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
i have a text file i want to read its word and search if it match some keywords saved in access table, i read from file successfully but how can i compare each word in text with each key word in the table, how can i know the frequency for each word in the text
SUMA
|
|
|
|
|
In Java you can set an method to be synchronized. As I'm new to C# i would know how locking works in C#? If any of you knows about book that covers real time programming in C# it would make my day.
|
|
|
|
|
|
You can accomplish the same with something like this:
using System.Runtime.CompilerServices;
...
[MethodImpl(MethodImplOptions.Synchronized)]
void MySychronizedMethod()
{
}
Typically, C# synchronization is done with the lock keyword:
lock(someObj)
{
...
}
|
|
|
|
|
Hi all,
I'm very new to programming in C# (and programming in general). I'm getting "Syntax error in INSERT INTO statement." and I haven't got a clue why.
Here's the code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Data.SqlClient;
namespace dbTest
{
public partial class Form1 : Form
{
String conString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Temp\MasterInventory2.mdb";
OleDbConnection con = new OleDbConnection();
DataTable dtCardlist = new DataTable();
DataTable dtTemp = new DataTable();
OleDbDataAdapter daCardlist;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
con.ConnectionString = conString;
daCardlist = new OleDbDataAdapter("Select * From Cardlist", con);
daCardlist.Fill(dtCardlist);
dataGridView1.DataSource = dtCardlist;
}
private void button2_Click(object sender, EventArgs e)
{
con.Open();
daCardlist.InsertCommand = con.CreateCommand();
daCardlist.InsertCommand.CommandText = "INSERT INTO Cardlist "+
"(Name, Set, Cost, Type, PowTgh, Rules, Rarity) "+
"VALUES "+
"(?,?,?,?,?,?,?)";
daCardlist.InsertCommand.Connection = con;
daCardlist.InsertCommand.Parameters.Add("Name", OleDbType.Char, 0, "Name");
daCardlist.InsertCommand.Parameters.Add("Set", OleDbType.Char, 0, "Set");
daCardlist.InsertCommand.Parameters.Add("Cost", OleDbType.Char, 0, "Cost");
daCardlist.InsertCommand.Parameters.Add("Type", OleDbType.Char, 0, "Type");
daCardlist.InsertCommand.Parameters.Add("PowTgh", OleDbType.Char, 0, "PowTgh");
daCardlist.InsertCommand.Parameters.Add("Rules", OleDbType.Char, 0, "Rules");
daCardlist.InsertCommand.Parameters.Add("Rarity", OleDbType.Char, 0, "Rarity");
DataRow newRow = dtCardlist.NewRow();
newRow["Name"] = "testCard2";
newRow["Set"] = "TST";
newRow["Cost"] = "Cost";
newRow["Type"] = "Type";
newRow["PowTgh"] = "PowTgh";
newRow["Rules"] = "Rules";
newRow["Rarity"] = "Rarity";
dtCardlist.Rows.Add(newRow);
daCardlist.Update(dtCardlist);
con.Close();
}
}
}
I suspect that it's something really simple, but I just don't see it.
Any help is appreciated.
|
|
|
|
|
"Name" is a reserved word in Access.
"Set" is a reserved word in Access and in OleDb.
---
b { font-weight: normal; }
|
|
|
|
|
I've been looking at the text for two days, and I didn't see THAT!
Anyway, I've changed the "Set" to "Cardset" and everything works perfectly.
Thanks!
|
|
|
|
|
HI . I want to filter the data of a column of an asp grid view on basis of a value given in a text field. These text fields should be visible on top of every column(below the header text). How can i do it? Your response in this regard will be appreciated. Thanks
|
|
|
|
|
Hi!
please tell me hOw we can change Attribute Names of a particular "element" after loading document in XmlDocument class.
Thanks
|
|
|
|
|
Here is a way that keeps the attribute's orignal value and position: There may be a simplier solution.
using System;
using System.Xml;
namespace CSharp
{
class Program
{
static void Main(string[] args)
{
String xml =
"<?xml version='1.0' encoding='UTF-8'?>" +
"<book name='Introduction to C# 2.0'/>";
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xml);
XmlElement docElem = xmlDoc.DocumentElement;
XmlAttribute attribName =
xmlDoc.DocumentElement.Attributes["name"];
XmlAttribute attribTitle =
xmlDoc.CreateAttribute("title");
attribTitle.Value = attribName.Value;
docElem.Attributes.InsertBefore(attribTitle, attribName);
docElem.Attributes.Remove(attribName);
Console.WriteLine(xmlDoc.OuterXml);
}
}
}
|
|
|
|
|
hellow to all ..
i am trying to creat a public variable in my forum that i could access it from othere forms ..
but it is not working for me ..
how can i creat it ...
thxx
|
|
|
|
|
The simplest solution is to create a class with a static field in your Forms namespace.
<br />
class MyClass<br />
{<br />
public static int publicVariable = 0;<br />
}<br />
You access the variable above by: MyClass.publicVariable = 10;
|
|
|
|
|
Don't use public variables, use public properties.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
i want the code to enable one button out of three when other two are are disable and vice versa in c#.net
ursbuddy
|
|
|
|
|
That's pretty straightforward. What have you tried ? To tie the three buttons together, you'd need to create a control. It's easier just to write code that enables one button and disables the other two.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
you must think about how this will logically work then......
Toggle between the button.enabled property.
if you want the button disabled you say button1.enabled = false;
if you want the button enabled you say button1.enabled = true;
That should u going dude.
|
|
|
|
|
hi
i am using vc# 2005 and sql 2005 express.
my problem is does exist any way to set password on sql2005 database ?
(because i don't want to end users access to sql server's tables and datas and ...)
how to solve my problem ?
thanks
|
|
|
|
|
I think you need to download SQL Server express 2005 management studio, this programme gives you control over the security functions of the database.
You will have to connect to your MDF file using this.
You should then be able to create a fairly strong username and password.
you can do these changes using sql commands but i would use the management studio.
Then when you first create a new datasource in C# express edition do not use windows authentication to connect to the database use your new admin username and password.
Hope this helps
|
|
|
|
|
It should be as regedit.exe. How to deduce data from the register?
|
|
|
|
|
YOu want to write a console app to edit the registry ? Why ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|