|
|
|
Message Closed
modified 1-Jan-16 11:59am.
|
|
|
|
|
Suggest you to post your advertisement in Job portal.
Else, any freelance website.
Life is a computer program and everyone is the programmer of his own life.
|
|
|
|
|
I want to add a filter button to the datagrid with, but it shows an error in the dataview constructor ('The name 'ds' does not exist in the current context'). What might be wrong?
public void filtrar_Click(object sender, EventArgs e)
{
DataView dv = new DataView(ds);
dv.AllowNew = false;
dv.AllowDelete = true;
dv.RowFilter = "NIF Like '" + textBoxNIF.Text + "*'";
grid_lic.DataSource = dv;
}
public void Consulta()
{
con = new OdbcConnection("driver= {MySQL ODBC 5.1 Driver};server=192.168.19.78; database=licenciamento; uid=estagio; password=1234; option = 3 ");
con.Open();
OdbcCommand Command = con.CreateCommand();
Command.CommandText = "select lojas.Id, lojas.NIF, lojas.Loja, lojas.Bloquear, lojas.DataFim, lojas.lastupdate, lojas.Nome, " +
" licenciamentoloja.EArtigo, licenciamentoloja.EFamilia, licenciamentoloja.EClientes, licenciamentoloja.EFornecedores, licenciamentoloja.Evendas," +
"licenciamentoloja.ECompras, licenciamentoloja.EStocks, licenciamentoloja.ELiquidacao, licenciamentoloja.ECaixas, licenciamentoloja.EInfoStock," +
"licenciamentoloja.ZSArtigos, licenciamentoloja.ZSClientes, licenciamentoloja.ZSStocks, licenciamentoloja.id from lojas inner join licenciamentoloja on lojas.NIF = licenciamentoloja.NIF and lojas.Loja = licenciamentoloja.loja";
Command.CommandType = CommandType.Text;
Command.Connection = con;
OdbcDataAdapter adapter = new OdbcDataAdapter();
adapter.SelectCommand = Command;
DataSet ds = new DataSet();
adapter.Fill(ds);
grid_lic.DataSource = ds;
grid_lic.DataMember = ds.Tables[0].TableName;
|
|
|
|
|
The error is telling you exactly what's wrong. "ds " has not been declared inside the function.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
ds is already declared in function Consulta()
How do I declare it inside function dataview?
|
|
|
|
|
The way you're using it, you might want to declare it at the class level. That way it will be accessible to all the functions in the class.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|

public void Consulta()
{
con = new OdbcConnection("driver= {MySQL ODBC 5.1 Driver};server=192.168.19.78; database=licenciamento; uid=estagio; password=1234; option = 3 ");
con.Open();
OdbcCommand Command = con.CreateCommand();
Command.CommandText = "select lojas.Id, lojas.NIF, lojas.Loja, lojas.Bloquear, lojas.DataFim, lojas.lastupdate, lojas.Nome, " +
" licenciamentoloja.EArtigo, licenciamentoloja.EFamilia, licenciamentoloja.EClientes, licenciamentoloja.EFornecedores, licenciamentoloja.Evendas," +
"licenciamentoloja.ECompras, licenciamentoloja.EStocks, licenciamentoloja.ELiquidacao, licenciamentoloja.ECaixas, licenciamentoloja.EInfoStock," +
"licenciamentoloja.ZSArtigos, licenciamentoloja.ZSClientes, licenciamentoloja.ZSStocks, licenciamentoloja.id from lojas inner join licenciamentoloja on lojas.NIF = licenciamentoloja.NIF and lojas.Loja = licenciamentoloja.loja";
Command.CommandType = CommandType.Text;
Command.Connection = con;
OdbcDataAdapter adapter = new OdbcDataAdapter(Command);
DataSet ds = new DataSet();
adapter.Fill(ds,"temp");
grid_lic.DataSource = ds;
grid_lic.DataMember = ds.Tables[0].TableName;
Pass the command object in adapter
|
|
|
|
|
you also write like this
//your connection
//your command
odbcDataAdapter dt=new odbcDataAdapter(command);
dataset ds= new dataset();
dt.fill(ds,"temp");
gridview1.datasource=ds;
|
|
|
|
|
i have a web application running on a server. This application needs to fetch data from some other PC(Clients), which are on a different network.
In this case web application is showing real time data from client pc which is logged in.
what technologies i have to used??
|
|
|
|
|
What kind of "real time data" you want to fetch?
You have just been Sharapova'd.
|
|
|
|
|
Real time data like client pc CPU usage, available ram memory, used ram .
In short server and clients share data with each other.
|
|
|
|
|
What have you found in your research on server<=>client communication in Windows ?
«Tell me and I forget. Teach me and I remember. Involve me and I learn.» Benjamin Franklin
|
|
|
|
|
I found that signalr technology is good in term of server-client communication.
but issue i got in this is authentication ...
other technology which is socket programming. but it has some limitation and require ssl certificate if it run on public IP.
i want like client can login on web portal and send-receive data from windows application which is installed on windows with same credentials. means user can do action from web portal from anywhere if windows exe is installed and logged in.
|
|
|
|
|
gautamkhatri428 wrote: This application needs to fetch data from some other PC Actually it is the other way round, the client PC needs to send the data to the server. Socket connections or WCF would be the way to do it.
|
|
|
|
|
it is possible in WCF to send data from server to client and vice versa .. simultaneously ???
and socket programming requires ssl certificate and then need to install certificate on client pc.
|
|
|
|
|
gautamkhatri428 wrote: it is possible in WCF to send data from server to client and vice versa .. simultaneously ? I assume so, but you need to read the documentation.
gautamkhatri428 wrote: socket programming requires ssl certificate Not necessarily.
|
|
|
|
|
In order of your questions:
1. Yes
2. No, it isn't.
This space for rent
|
|
|
|
|
Also keep in mind that when he said "the client PC needs to send the data" that means that software to do just that must be running on the client machine.
The client, not the server.
Your question then is pointless unless you can install your software on the server. The client might provide some way to retrieve that information by itself. However for you to use that you must
1. Find that software
2. Insure it is running
3. Insure that it can be accessed from your server
4. Figure out the protocol of 1 and then use it
Not that 4, which is basically your original question, is pointless until 1 to 3 have been resolved.
|
|
|
|
|
Hi,
I 'am trying to call default.html from my universal C# project ,a file in which I have defined my Google map,this is the tutorial reference:
Google Maps API on Windows Store App 8.1
and this is my code: in MainPage.xaml.cs:
public MainPage()
{
this.InitializeComponent();
LoadData();
MapWebView.NavigateToString(GeneratedHTML);
}
private async void LoadData()
{
try
{
await loadJsonLocalnew("default.html", "");
}
catch (Exception ex)
{
throw;
}
}
public async static Task loadJsonLocalnew(string url, object ClassName)
{
try
{
var folder = await StorageFolder.GetFolderFromPathAsync(Windows.ApplicationModel.Package.Current.InstalledLocation.Path + @"\");
StorageFile file = await folder.GetFileAsync(url);
Stream stream = await file.OpenStreamForReadAsync();
StreamReader reader = new StreamReader(stream);
String html = reader.ReadToEnd();
GeneratedHTML = html.ToString();
}
catch (Exception ex)
{
}}
this is the xaml file:
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<WebView x:Name="MapWebView" Width="Auto" Height="700"/>
</Grid>
but this time the html variable has this content:
Some files or contents of this website require a program that is not installed on your computer.
and I get a white page how can I deal with this problem
thanks for help
|
|
|
|
|
var folder = await StorageFolder.GetFolderFromPathAsync(Windows.ApplicationModel.Package.Current.InstalledLocation.Path + @"\");
StorageFile file = await folder.GetFileAsync(url);
You declare and initialize a variable named folder , but then you never use it.
Were you supposed to combine the folder path with the url to form the complete path to default.html ?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
is it possible to setpixel and getpixel on controls?
|
|
|
|
|
|
No, because GetPixel and SetPixel are part of the Bitmap class, and Controls are not derived from Bitmap.
What are you trying to achieve that you think you need this?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|