|
I have been researching. So far I have come across.
--select * from sys.dm_exec_connections
select * from sysobjects where [name] like 'dbo.%'
select * from INFORMATION_SCHEMA.TABLES
select table_name as Name from INFORMATION_SCHEMA.Tables where TABLE_TYPE = 'BASE TABLE'
SELECT * FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'tblprweekendingdates'
in sql server studio manager. Would it be true to sql I can pass these sql statements to a given database via a odbc connection and return the same results?
|
|
|
|
|
when you using odbc as connection source then there are some security issue you must concern..for example
you are connected with database "A" the you cannot fully access to other database if you are not authorized...
You need to check that your loginID is authorized or not to perform transact-sql statement execution to the desire one using odbc.
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
Access will be pretty simple, I will be astonished if Quickbooks publish their schema or allow you to query their system tables.
As for cobol I'm not sure cobol even has the metadata to query!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi.
I have problems..when i send string from client to server, server recieves string and sends it back to client. Works fine for first time. But now i don't know why i can't send it again, lets say different..
Here is code for server:
public server()
{
InitializeComponent();
}
private void server_Load(object sender, EventArgs e)
{
IPAddress ipAd = IPAddress.Parse("127.0.0.1");
TcpListener myList = new TcpListener(ipAd, int.Parse("1111"));
myList.Start();
try
{
Socket socketForClient = myList.AcceptSocket();
Console.WriteLine("Odjemalec povezan " + socketForClient.RemoteEndPoint.ToString());
NetworkStream networkStream = new NetworkStream(socketForClient);
StreamWriter streamWriter = new StreamWriter(networkStream);
StreamReader streamReader = new StreamReader(networkStream);
line = streamReader.ReadLine();
Console.WriteLine("Sprejeto: " + line);
textBox1.Text = line;
streamWriter.WriteLine(line);
Console.WriteLine("Poslano: " + line);
streamWriter.Flush();
Console.WriteLine();
}
catch (Exception x)
{
Console.WriteLine("Error..... " + x.StackTrace);
}
}
Here is code for my server
private string _ip = String.Empty;
private string _port = String.Empty;
private int izbira;
string novo;
TcpClient odjemalec = new TcpClient();
public client(string ip, string port)
{
InitializeComponent();
this._ip = ip;
this._port = port;
}
private void client_Load(object sender, EventArgs e)
{
try
{
IPAddress novip = IPAddress.Parse(_ip);
Console.WriteLine("Povezujem ...");
odjemalec.Connect(novip, int.Parse(_port));
Console.WriteLine("Povezan");
Console.Write("Vpiši besedilo: ");
String line = Console.ReadLine();
}
catch (Exception x)
{
Console.WriteLine("Napaka: " + x.Message);
}
}
private void poslji()
{
if (comboBox1.SelectedIndex == 0) novo = "1";
if (comboBox1.SelectedIndex == 1) novo="2";
NetworkStream networkStream = odjemalec.GetStream();
StreamReader streamReader = new StreamReader(networkStream);
StreamWriter streamWriter = new StreamWriter(networkStream);
streamWriter.WriteLine(novo);
Console.WriteLine("Pošiljam sporočilo...");
streamWriter.Flush();
string s = streamReader.ReadLine();
textBox1.Text = s;
Console.WriteLine("Prejemam sporočilo...");
Console.WriteLine(s);
}
string textbox()
{
novo = textBox1.Text;
return novo;
}
private void button1_Click(object sender, EventArgs e)
{
poslji();
}
Please help me that i would be able to send more than one time.
|
|
|
|
|
The same question, over and over.
I told you before, store your connection stuff in class members, not local variables, keep them open, reuse them.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Yeah but i don't know how you mean this..DO i have to make class just for streaming...or for starting tcplistener and client or can i make everything in one class?
|
|
|
|
|
you only need to create one class, it should contain about half of the code you have shown. Typically:
- an open method
- one or multiple use methods (read, write)
- a close method
Do you know how to work with files? it is basically the same.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Ok..i made new class for most of the code.. now i get error when i try to start streaming client.. here i have code in that class:
public void start_client()
{
IPAddress novip = IPAddress.Parse(_ip);
Console.WriteLine("Povezujem ...");
odjemalec.Connect(novip, int.Parse(_port));
Console.WriteLine("Povezan");
}
public void streamaj_client()
{
NetworkStream networkStream = odjemalec.GetStream();
StreamReader streamReader = new StreamReader(networkStream);
StreamWriter streamWriter = new StreamWriter(networkStream);
streamWriter.WriteLine(podatki);
Console.WriteLine("Pošiljam sporočilo...");
streamWriter.Flush();
string s = streamReader.ReadLine();
Console.WriteLine("Prejemam sporočilo...");
Console.WriteLine(s);
}
here are two methods..i get error at NetworkStream networkStream=odjemalec.GetStream(); It says networkStream=null? But i have connected client to server and it says in console that is connected. What am i doing wrong now?
|
|
|
|
|
|
Why you post this type of queries in this forums....
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
Hi people
I've got a rather simple question. In my app, I want to 100 by a certain number, and then store the result in a double, or other suitable variable. Lets say I want to say 100/48, the result is 2.0833333. When I try this though, the result always gets rounded off to the nearest decimal. So the result in my app would return 2.0 How can I get it to store 2.083 instead?
|
|
|
|
|
The result of integer division is always an integer; if you want a real (i.e. float or double) result, make sure at least one of the operands is real; for constants, append ".0" to the number, for variables use a float/double variable, or cast to float or double. Examples:
100.0/48
100/48.0
100/(double)INT48
((double)INT100)/48
DOUBLE100/48
100/DOUBLE48
Then optionally use formatting to get the number of decimals you want, as in x.ToString("N3"); or x.ToString("F3");
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Thanks alot.
This works perfectly
|
|
|
|
|
you're welcome.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
No offense but you really should have known that.
|
|
|
|
|
sure, using a language assumes such basic knowledge; however if he were an experienced VB programmer, things get confusing as division behaves somewhat differently in VB.
And how often do we see things questions like: why do I get zero from percent = current/maximum*100; ?
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Luc Pattyn wrote: And how often do we see things questions like: why do I get zero from percent = current/maximum*100;?
Too often. But that's more of an operator precedence problem IMO
|
|
|
|
|
Not in VB, if you do
Dim a As Integer = 1 / 3 * 100
the result is 33 (unless you have Option Strict On, then it results in an error); in C-like languages 1 / 3 * 100 is zero.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Well VB is odd. I didn't know it was That odd, but then I'm not a VB programmer and I've never written a single line of VB
|
|
|
|
|
Uhm beginner coders are also allowed to ask questions aren't they?
|
|
|
|
|
Absolutely!
Your question was easy to understand, even if it appeared simple to some members. They forget that they didn't know things not so very long ago.
As long as you continue to post clearly defined questions, carry on doing so.
Bear in mind however that if you ask too many really simple questions, all you will get back is suggestions that you buy a beginners book. Which is not a bad idea. It gets you past the really simple stuff and using the IDE and so on, so you might consider that anyway.
[Edit]
It has been pointed out to me that it is not enough to just buy a beginners book. You have to read it as well and work through the examples it contains.
[/Edit]
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.”
|
|
|
|
|
Henry Minute wrote: buy a beginners book
doesn't help at all. You have to study the book; owning it and keeping it around for future reference is a good idea, however it isn't sufficient.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Edited, to comply.
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.”
|
|
|
|
|
Excellent.
This[^] offers even more suggestions.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
hy
How to prevent of the opening source in the .net , by reflector or
etc.
|
|
|
|