|
Hi
In my application i am trying to play up to 12 videos simultaneously and I am accessing the videos on a mapped network drive. Can someone please point me at some literature or some examples of buffering video files.
Thanx
|
|
|
|
|
|
I have done code to print the table columns using SQLDMO.
How can i acces the data of the tables? pl reply quickly
|
|
|
|
|
If you can print the columns using SQLDMO, then you must know the following.
1. Database name
2. Table names
3. Column names
With those three you have enough information to use standard queries to retrieve the data. Don't forget to use Parameterised queries to avoid SQL Injection attacks.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thing is that I want to print table rows with change of database dynamically in a combobox.So I cannot predefine the database.I have Printed columns dynamically using SQLDMO.Column2 .Similarly can i use some tools to print datas of the tables.Can u help me?
|
|
|
|
|
I am not sure that I understand exactly what you are saying.
Do you mean that the database names are in a combobox and when that changes, you want to do your printing?
Or are you saying that you want to print the data in a combobox when the database changes for some unspecified reason?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
1)I have two combo box.
2)First one will show all DataBases in a particular Server
3) Second one will show all Tables in the coreesponding Database Selected from Above
4)Connection is defined in Webconfig
5)When I press Generate Script(button) it should print INSERT command
Since In webconfig I have said DBaseName
I could get column Script Using SQLDMO.
I couldnot get Row Script for other tables.
I want to use SQLDMO Direcly to a table to get the rows?
Hope you got Some Idea
|
|
|
|
|
Thank you for clarifying, I understand now.
I have a very similar app but mine is on Windows Forms. In mine I do pretty much as you do, except that I have 1 ComboBox and 1 ListBox. For my app I fall back to standard SQL Queries for data retrieval (as I said before by this stage you have all necessary information to do so) because, as far as I know, SMO/DMO has no commands suitable for this purpose.
The only way that I am aware of to use DMO for this is as described in this[^] article. See the 'Issuing a DDL or DML Command' section.
I hope that this is of some help to you.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thank you Henry Minute for Clearing My doubt.See U later ok.
|
|
|
|
|
Hi,
I have a class (call it Fred) which contains several static classes (call them Freds_Box1, Freds_Box2 etc) which are identical in structure.
In a component I have a "Fred_Box". I want to be able to select which "Fred_Box" this points to out of all the "Freds_Boxe's" in "Fred" using the property explorer.
Defining the components "Freds Box" selection in code is easy and works perfectly but as Fred will be accessed by a whole bunch of components using data sources contained in the "Freds Box" selected, I need to be able to do this from the property explorer.
This is hard to explain, I hope it makes sense - here is some example code (untested, but it should hopefully get the point across!).
public class Fred
{
public static Freds_Box1 = new Freds_Box();
public static Freds_Box2 = new Freds_Box();
}
public partial class SomeComponent : UserControl
{
//the code way which works but isn't selectable:-
//private Freds_Box _Local_Freds_Box = Fred.Freds_Box1;
private Freds_Box _Local_Freds_Box;
//this property does not allow selecting anything, how can I "point" it at "Fred"
//so that I can select say "Freds_Box_1" from the list?
public Local_Freds_Box
{
get { return Local_Freds_Box; }
set { Local_Freds_Box = value; }
}
}
Any help with this would be greatly appreciated!!
Thanks.
|
|
|
|
|
Why don't you make a collection of Freds_Box()?
|
|
|
|
|
I should have mentioned that the application will contain multiple forms, with multiple components that access data in Fred. Would a collection still help me with that? (I have only just started using collections and don't really understand them properly yet).
|
|
|
|
|
Go easy, start with plain arrays: (of course replace Freds_Box with the REAL class)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
public class Freds_Box
{
public int somedata;
public Freds_Box(int HowMuch)
{
somedata = HowMuch;
}
}
public class Fred
{
private Freds_Box[] freds_Boxes = new Freds_Box[] {new Freds_Box(25),
new Freds_Box(79)
};
public Freds_Box[] Freds_Boxes
{
get { return freds_Boxes; }
set { freds_Boxes = value; }
}
}
class Program
{
static void Main(string[] args)
{
Fred container = new Fred();
Console.Write(container.Freds_Boxes[0].somedata);
Console.Write(container.Freds_Boxes[1].somedata);
}
}
}
|
|
|
|
|
What are you actually trying to achieve with this?
I ask because it seems a long winded way to do whatever it is you are trying to do.
What is it not working? I tried it and it worked fine (I had to dummy the Freds_Box class):
public class Fred
{
public static Freds_Box Freds_Box1 = new Freds_Box("Box 1");
public static Freds_Box Freds_Box2 = new Freds_Box("Box 2");
}
public class Freds_Box
{
public string Fred;
public Freds_Box(string init)
{
Fred = init;
}
}
public partial class SomeComponent
{
private Freds_Box _Local_Freds_Box;
public SomeComponent(int i)
{
if (i == 1)
{
_Local_Freds_Box = Fred.Freds_Box1;
}
else
{
_Local_Freds_Box = Fred.Freds_Box2;
}
}
public Freds_Box Local_Freds_Box
{
get { return _Local_Freds_Box; }
set { Local_Freds_Box = value; }
}
}
and a button:
private void button1_Click(object sender, EventArgs e)
{
SomeComponent sc1 = new SomeComponent(1);
SomeComponent sc2 = new SomeComponent(2);
MessageBox.Show("sc1: " + sc1.Local_Freds_Box.Fred + "\n" + "sc2: " + sc2.Local_Freds_Box.Fred);
}
Message box:
"sc1: Box 1"
"sc2: Box 2"
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
Hello All ,
Is there a way to display list (containing strings) items in a message box?
List<string> test = new List<string>();
test.add("one");
test.add("two");
test.add("three");
And then displaying all the list items together in a single message box?
Like
<br />
MessageBox.Show(test);
Thanks,
|
|
|
|
|
Not as far as I am aware.
However, a Messagebox is nothing much more than a Dialog. Design your own.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Following is basic example to do so.
MessageBox.Show(string.Concat(test.ToArray()));
You can explore more to fulfill your requirement or to customize it at
whatever level you need.
Hope this will help!
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
try
MessageBox.Show(string.Join(Environment.NewLine,test.ToArray()));
|
|
|
|
|
Hi,
I develop a GMAO csharp smart device application.I try now to connect to my remote database.mdf using TCP/IP protocol.I created a combobox where i want to extract informations from my table using this select statement:
"SELECT DISTINCT NObt FROM 4BT "; .For my IPadreess of my computer,I use the ipconfig/all command and I take the
IPv4 Address. . . . . . . . . . . : 192.168.1.4(Preferred)
My hole code is like this:
using System;
using System.Linq;
using System.Data.SqlServerCe;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace ModeDifféré
{
public partial class Form6 : Form
{
public Form6()
{
InitializeComponent();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void Form6_Load(object sender, EventArgs e)
{
string sConnection = "Data Source=192.168.1.4,1433;Initial Catalog=GMAO;User ID=sa;Password=sa;";
string sSQL = "SELECT DISTINCT NObt FROM 4BT";
SqlCeCommand comm = new SqlCeCommand(sSQL, new SqlCeConnection(sConnection));
SqlCeDataReader dr = null;
try
{
comm.Connection.Open();
dr = comm.ExecuteReader();
while (dr.Read())
comboBox1.Items.Add(dr[0]);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return;
}
dr.Close();
comm.Connection.Close();
}
}
}
When running,this error appears:
Unknown connection option in connection string: initial catalog.
As an information,I follow the steps of this link:http://netcf2.blogspot.com/2005/12/accessing-sql-server-express-from.html[^]
What is the problem???
Thank u for all u suggestion
Regards
Marwen
|
|
|
|
|
You're trying to access a Sql Express-database using the classes that are designed for SqlCe. Those are two different database-systems; Sql Express is server-based, and you connect using a SqlConnection . SqlCe is file-based, that's what's on your mobile device.
Change the data-provider and it should work.
I are Troll
|
|
|
|
|
Hi Eddy,
sorry but i don't understand what u mean and how can i change the data-provide.I am not so good at english computer science vocablary.
Thanks
|
|
|
|
|
Tunisien86 wrote: I am not so good at english informatic vocablary.
Your English is fine, but there's a mixup in classes that act and look similar.
The one on the mobile device has an .sdf-extension and is a file-based datastore. You've already worked with this type of database. Typically, you make a SqlCeConnection [^] and execute a SqlCeCommand [^].
The database on Sql Server has a .mdf extension, and is a server-based datastore. It works in a similar fashion, you open a SqlConnection [^] and execute your SqlCommand [^]
In short, when you talk to .sdf you use a SqlCeConnection, when you talk to an .mdf you use a SqlConnection. The long story can be found on MSDN[^].
I are Troll
|
|
|
|
|
Hi Eddy,
Thanks a lot for u collaboration .I understand u meaning.I make changement but still not working.
My new code is like that:
using System;
using System.Linq;
using System.Data.SqlServerCe;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace ModeDifféré
{
public partial class Form6 : Form
{
public Form6()
{
InitializeComponent();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void Form6_Load(object sender, EventArgs e)
{
string sConnection = "Data Source=192.168.1.4,1433;Initial Catalog=GMAO;User ID=sa;Password=sa;";
string sSQL = "SELECT DISTINCT * FROM D°_urgence";
SqlCommand comm = new SqlCommand(sSQL, new SqlConnection(sConnection));
SqlDataReader dr = null;
try
{
comm.Connection.Open();
dr = comm.ExecuteReader();
while (dr.Read())
comboBox1.Items.Add(dr[0]);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return;
}
dr.Close();
comm.Connection.Close();
}
}
}
In fact,my combobox should contain the result of my select statement,but when running,the system is show an sqlexception and nothing is added to my combobox.
Is the IPadress the problem?the ipconfig command returns to me this:
C:\Users\Admin>ipconfig /all
Windows IP Configuration
Host Name . . . . . . . . . . . . : Admin-PC
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
Wireless LAN adapter Wireless Network Connection 2:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft Virtual WiFi Miniport Adapter
Physical Address. . . . . . . . . : 06-1B-9E-4A-A0-8C
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Wireless LAN adapter Wireless Network Connection:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Atheros AR5007EG Wireless Network Adapter
Physical Address. . . . . . . . . : 00-1B-9E-4A-A0-8C
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::cc28:8ea3:82ea:4c4f%13(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.1.4(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : mercredi 5 mai 2010 10:08:26
Lease Expires . . . . . . . . . . : jeudi 6 mai 2010 10:08:25
Default Gateway . . . . . . . . . : 192.168.1.1
DHCP Server . . . . . . . . . . . : 192.168.1.1
DHCPv6 IAID . . . . . . . . . . . : 234888094
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-13-55-22-65-00-1A-92-FC-E6-7E
DNS Servers . . . . . . . . . . . : 192.168.1.1
192.168.1.1
NetBIOS over Tcpip. . . . . . . . : Enabled
Ethernet adapter Local Area Connection:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . : home
Description . . . . . . . . . . . : Realtek RTL8139/810x Family Fast Ethernet
NIC
Physical Address. . . . . . . . . : 00-1A-92-FC-E6-7E
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter isatap.home:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter Local Area Connection* 11:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft Teredo Tunneling Adapter
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
IPv6 Address. . . . . . . . . . . : 2001:0:4137:9e74:454:bc2:3f57:fefb(Prefer
red)
Link-local IPv6 Address . . . . . : fe80::454:bc2:3f57:fefb%11(Preferred)
Default Gateway . . . . . . . . . : ::
NetBIOS over Tcpip. . . . . . . . : Disabled
Tunnel adapter isatap.{9CD32A2C-C6BD-42FC-9F45-933E12729451}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter isatap.{13CC6962-1531-4DD0-BC0C-47DEA185DF81}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
.
I took the
IPv4 Address. . . . . . . . . . . : 192.168.1.4(Preferred)
Or should I take the physical @ as the @ of my computer?
I really i don't understand the problem.
Thanks
|
|
|
|
|
Hi Calla,
Eddy suggests that i change sqlcecommand to sqlcommand because I use .mdf database.
Or i don't know maybe i am not understanding what he said
Thanks
|
|
|
|
|
You'll have to check
1) Do you have network connectivity on your emulator: start Internet explorer on the emulator, and try to access a well known website (www.codeproject.com).
2) Is your firewall open on port 1433?
Also, which exception are you getting now? we need the full text of the exception, which you should now have, if you followed Luc Pattyns' code.
|
|
|
|