|
|
Hi All,
I have a table control that is dynamically populated from my db, my db has 3 rows and the 3 rows are displayed which is working fine. what I want to achieve is "I want the table control to display a separator after a record is displayed" what I mean is this:
Assuming I have my 3 records displayed this way:
A
B
C
I want the table control to display a line separator like this
A
-
B
-
C
-
can any one help me out please?
thanks.
|
|
|
|
|
once you realize that a row is completed add a tr dynamically to your table, that way i guess you could get a seperator!!
Gautham
|
|
|
|
|
thanks.
But how do I add tr to a table control in code behind?
|
|
|
|
|
craete a tablerow like htmltablerow tr in your code, lets say your table id is table1 then table.add(tr) should do i guess!!!, syntax might be wrong!!!
Gautham
|
|
|
|
|
Is it possible to have multiple machine.config files in a computer.
Ananth
|
|
|
|
|
Hi,
We have decided to develop our new portal using ORM tool, which should be flexible enough to support multiple DB, say for example SQLServer, MySql, Oracle etc. We are using Visual studio 2005, ASP .Net 2.0 using C# 2.0
We got some suggestion to go for DevExpress XPO, We tried that but with XPO We found that if We go for Stored Procedure, We had to use sql parameter and if so then how that could be db independent. and we higly use SP's and even with using XPO there might be cases that we might have to use SP and if at that time our db will be Oracle or MySql then?
Any help would be highly appreciated.
Thanks,
-- modified at 6:49 Thursday 8th February, 2007
Best regards,
Niraj Parikh
|
|
|
|
|
Niraj Parikh wrote: I had to use sql parameter and if so then how that could be db independent.
what do you mean with sql parameter? do you mean binding variables?
like call myStoredProcedure(:1,:2) ?
m@u
|
|
|
|
|
Hi m,
Thx for ur reply.
Here abt "sql parameter" I mean "System.Data.SqlClient.SqlParameter" I can use "IDataParameter" also but in that case, I am unable to find size property for IDataPrameter.
If XPO is the right choice for Object-Relational Mapping Tool to support multiple DB then is it possible to support stored procedure with that?
Thanks,
-- modified at 6:58 Thursday 8th February, 2007
Niraj Parikh
|
|
|
|
|
Hi
i can't say that xpo is definitely the right choice for this, but what i can say is that i work pretty often with binding variables in oracle. there, thet parameter type is, (of course ), called OracleParameter and has also a property called Size, which i have never assigned anything to and it always worked fine yet..
However, if you look at System Data, you find the basic Class of all Connections called IdbConnection. so theoretically you could have one class which creates depending on what dbType you want to connect an SQLConnection or a MySQLConnection or whatever. to the other Classes which use the connection, you simply pass it as an IdbConection instance.
IdbConnection implements a function called CreateCommand() which passes you the basic-Class of all DBCommands: an IdbCommand. so you get an SQLCommand or whatever wrapped in an IdbCommand and you can set the CommandText and all the other things you need and you're still db-Independent.
that means, you could do it even without XPO because the .net System.Data - Namespace gives you theoretically everything you need to create a DB-Independent Application.
try the following:
let's say you implement a Connect() Method like this:
<br />
private IdbConnection Connect(string User, string Pass, string Connection, string Schema, string DBType)<br />
{<br />
IdbConnection RetVal = null;<br />
switch(DBType.ToLower())<br />
{<br />
case "oracle":<br />
{<br />
RetVal = new OracleConnection(User, Pass, Connection);<br />
IdbCommand cmd = RetVal.CreateCommand();<br />
cmd.Connection = RetVal;<br />
cmd.CommandText = string.Format("Alter Session set Current_Schema = \"{0}\"",Schema.ToUpper());<br />
cmd.ExecuteNonQuery();<br />
break;<br />
}<br />
case "sql":<br />
{<br />
}<br />
case "whatever":<br />
{<br />
}<br />
}<br />
}<br />
now you have a nice little Method that gives you a DataBase Independend Connection.
you can Create and Execute Commands on it without even knowing what Kind of DB your sitting on.
if you want to execute a StoredProcedure with 2 Parameters you simply say:
<br />
private void ExecuteSomeSP()<br />
{<br />
IdbCommand cmd = myConnection.CreateCommand();<br />
cmd.CommandText = "Execute Blah(:1,:2)";<br />
idbParameter Param = cmd.CreateParameter();<br />
Param.DbType = DbType.String;<br />
Param.Direction = ParameterDirection.Input;<br />
Param.Value = "Kaboom!";<br />
Param = cmd.CreateParameter();<br />
Param.DbType = DbType.Int64;<br />
Param.Direction = ParameterDirection.Input;<br />
Param.Value = (long)250;<br />
cmd.Connection = myConnection;<br />
cmd.ExecuteNonQuery();<br />
}<br />
so you see, by only accessing the System.Data Namespace you can theoretically create Database Independent Applications. I guess XPO will just wrap it to make it more comfortable to use, but basically it works without installing any third-party - Product.
I hope this helps
greets
M@u
|
|
|
|
|
Hi
Yes it really helped me a lot. Thanks for your prompt reply bro.
I have voted 5 for your reply and that shows how much I am satisfied with ur reply. Tthanx buddy for excellent explaination.
And just for your knowledge XPO is one of ORM tool, which Mapps Objects to database. it creates db tables and relationships based on your classes and relationships betwn them. Relationships among classes, we can achive using Association and attributes, we just need to create classes and ORM tools creates database tables along with relationship/constraints for you and thats for any database.
So I have come to know that without any TPC we can create db independent application using strength of core .net.
one more thing, while implementing your code I came across IDataParameter also. Can you please update me what is that and whats difference betwn
IDbDataParameter and IDataParameter? is it a alternate of each other in discussed case?
Thanks
Niraj Parikh
|
|
|
|
|
wow that sounds interesting
then i missunderstood the actual question
uhm about that IdbDataParameter and IDataParameter.. IdbDataParameter has only 3 properties precision, scale and size and i'm not exactly sure what that one's for..
in my example it was a typo that i used that one.. i meant IDataParameter...
greets
|
|
|
|
|
Hello,
I have an application with two buttons. First one connects to a server, second one should read data. But compiler does not know the name "master".
How could I manage this?
Thank you and regards,
Jens
private void Connect(object sender, EventArgs e)
{
TcpClient client = new TcpClient("127.0.0.1", 502))
ModbusTcpMaster master = ModbusTcpMaster.CreateTcp(client);
}
private void Read(object sender, EventArgs e)
{
// read five input values
ushort startAddress = 100;
ushort numInputs = 5;
bool[] inputs = master.ReadInputs(startAddress, numInputs);
for (int i = 0; i < numInputs; i++)
Console.WriteLine("Input {0}={1}", startAddress + i, inputs[i] ? 1 : 0);
}
|
|
|
|
|
Hello Jens,
You have to declare your ModbusTcpMaster outside the method. (class lokal)
private ModbusTcpMaster master;
private void Connect(object sender, EventArgs e)
{
TcpClient client = new TcpClient("127.0.0.1", 502))
master = ModbusTcpMaster.CreateTcp(client);
}
private void Read(object sender, EventArgs e)
{
// read five input values
ushort startAddress = 100;
ushort numInputs = 5;
if(master!=null) //Allways do a != null check
{
bool[] inputs = master.ReadInputs(startAddress, numInputs);
for (int i = 0; i < numInputs; i++)
Console.WriteLine("Input {0}={1}", startAddress + i, inputs[i] ? 1 : 0);
}
}
All the best,
Martin
|
|
|
|
|
|
|
Hi All,
Greetings. I've to assign the enum value to a object property. Which shows the following error.
Cannot convert type 'string' to 'Common.Enumerations.OffDate'
searchUIO.OffDate = (OffDate)ddlOffDate.SelectedValue;<br />
in this (OffDate) is an enum. the drop down list will contain the values lastweek, lastmonth like that. so i have to assing the value to the lefthand site object.
thanks in advance
Regards
babu
|
|
|
|
|
Take a look at the static Enum.Parse method.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hello,
As enum is an int type, you could make the enum casting with the SelectedIndex method.
searchUIO.OffDate = (OffDate)ddlOffDate.SelectedIndex;
All the best,
Martin
|
|
|
|
|
Thank you for your response. But i need to take the text value from the dropdown list.how i can do that??? Could you tell me the solution.
regards
babu
|
|
|
|
|
Have you tried the solution "Stefan Troschütz" posted?
|
|
|
|
|
Can i make a program that get some text from user and convert it to a sound ?
how make that ?
thanks
|
|
|
|
|
There was an API in C++ for converting text to speech. It sounded terrible. There's nothing built in standard, that's for sure.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You need a Text To Speech interface.
Such an interface is provided by Microsoft free and is called SAPI (Speech API) but i think that it was going to be upgraded and change name. Sorry i haven't gotten around it since 2003.
Need to know stuff.
SAPI is something like DirectX. It's Microsoft attempt to provide a generic interface for each interface realted to Speech Applications. Theretically each provider would comply and make his engine SAPI compliant.
SAPI when i used it in C++ it was very harsh. Even harsher than DirectX and there is not a lot of development going on, to find easily help
SAPI comes with the speech engine of Office intergrated. This means that without the need of a powerfull engine you can run your tests.
I think SAPi was renamed to ATL.
|
|
|
|
|
Sarafian wrote: I think SAPi was renamed to ATL
This is definately wrong. ATL has nothing to do with speech.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|