|
hi
Let me try to Help, because i once Referenced some DLLs to the Web Project. You Obviously have to Create two Projects , One that has your Class and will be Compiled into a DLL and your Web where you will be referencing it. So if yoou created this with VS.NET there is no problem.
Go to your referencing Project and Click on Add Reference and Click in the Project Tab and Choose the Project that Creates that DLL or your can Browse to it , after that in your Application you will access it like this
int num1 = Convert.ToInt32(txtnum1.Text);
int num2 = Convert.ToInt32(txtnum2.Text);
int Results;
createDll.Class1 myobj= new createDll.Class1();
Results = myobj.Add(num1,num2);
Be carefull when using Datatypes , use long when its really needed.
Hope this Helpes
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Does anyone know of a control in which I can check a word programmically to see whether it exists in a dictionary?
something like: boolean = spellcheck(word); where boolean is a true false result if the word exists.
It would be nice to have interop with MS Word dictionaries, but everything I have found is built straight into a textbox gui. I also need it to work with english and german words.
Thanks
|
|
|
|
|
I would like to be able to connect to and read/modify a local database file from the coding side of c#. I am using Visual C# 2008 Express Edition but don't want to use the 'Data Sources' wizard, but rather the 'SqlConnection' Coding commands.
I am using Microsoft SQL server 3.5 Database files.
Thanks in advance.
|
|
|
|
|
you should use Data class of framework.
Using data;
SqlConnection dataConn = new SqlConnection();,
dataConn.ConnectionString = "Integrated Security = True; Initial Catalog =dbName; Data Source=localhost;"
dataconn.open();
after this time u ll have a data conn what db you wrote there. Then time you should search what you wanna want.
thanks for everything i have...
|
|
|
|
|
Sorry, I have tried to connect using this method, the file is called Register.sdf and is in the same directory as the project content. This code fails to load the database effectively.
This is the code I am trying to use (The 'Global' Class is a static class containing the RegDB Variable)
private bool loadDatabase() {
Global.RegDB = new SqlConnection();
Global.RegDB.ConnectionString = "Integrated Security = True; Initial Catalog =dbName; Data Source=localhost;";
try {
Global.RegDB.Open();
return true;
}
catch {
return false;
}
}
|
|
|
|
|
TALHAKOSEN wrote:
did you take an error like below
TITLE: Connect to Server
------------------------------
Cannot connect to C:\DEV\SyncServices\learning\ConsoleSync1\ConsoleSync1\bin\Debug\awclientdb.sdf.
------------------------------
ADDITIONAL INFORMATION:
You are trying to access an older version of a SQL Server Compact Edition database. If this is a SQL Server CE 1.0 or 2.0 database, run upgrade.exe. If this is a SQL Server Compact Edition 3.0 or later database, run Compact / Repair. [ Db version = 3505053,Requested version = 3004180,File name = C:\DEV\SyncServices\learning\ConsoleSync1\ConsoleSync1\bin\Debug\awclientdb.sdf ] (SQL Server Compact Edition ADO.NET Data Provider)
------------------------------
BUTTONS:
OK
No, the function just failed in the try block and then returned false in the catch block
|
|
|
|
|
|
No, I don't think that I have explained myself correctly. I want to be able to access the database file as if it were a database, but without running SQL server. I plan to move the program to another machine that is not running SQL server.
|
|
|
|
|
You can't use a SQL Server database without SQL Server AFAIK.
SQL Server doesn't come built-in to the .NET framework.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Isn't that like trying to open an MS Excel document without Microsoft Excel? I imagine, if you want, you could open the SDF as a text file and have a look inside, but it won't act as a database without a database server. The clue is in the name - server. It 'serves' the data. The fact that the underlying datastore is a file is irrelevant.
Knowledge is hereditary, it will find its way up or down.
Luc Pattyn
and since what every time when i want to add button to this control one add two times
posted in C# forum
|
|
|
|
|
Ok, Thanks. I will investigate using SQLite as I have haerd that that can be used without a server (I.E Integrated)
Thanks anyway.
|
|
|
|
|
My Paranoid Hubby wrote: anyone else getting sick of this basic question?
Yes, which is why I generally ignore them.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Right Click your project in Solution Explorer,
Add / Component / SQL Database
You can then use the database as a file in your project.
Kind Regards.
|
|
|
|
|
Well, it sounds like you are using SQL Server Compact Edition 3.5, which means SqlConnection is not what you want. You need to use the System.Data.SqlServerCe[^] namespace. There are a lot of samples out there just for that, like this one[^].
|
|
|
|
|
Hi to all,
I am doing DirectShow Programming in VC++ & C#.Net.
I am using "MPEG-2 Multicast Receiver" filter & using IMulticastConfig interface on it.
In VC++, when I use SetMulticastGroup(ip, port) of IMulticastConfig it sets port properly to the filter.
But when same thing I do in C#.Net (same code of VC++), it fails to sets different port to that filter. (every-time sets a new port. No compilation or run-time error).
For C#.net, IMulticastConfig is written using IMulticastConfig of DirectX 9.0 of VC++.
Following is my interface,
<br />
using System.Runtime.InteropServices;<br />
<br />
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,<br />
Guid("1CB42CC8-D32C-4f73-9267-C114DA470378"),<br />
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]<br />
public interface IMulticastConfig<br />
{<br />
[PreserveSig]<br />
int SetNetworkInterface([In] ulong ulNIC);<br />
<br />
[PreserveSig]<br />
int GetNetworkInterface([Out] ulong pNIC);<br />
<br />
[PreserveSig]<br />
int SetMulticastGroup([In] ulong ulIP, [In] ushort usPort);<br />
<br />
[PreserveSig]<br />
int GetMulticastGroup([Out] ulong pIP, [Out] ushort pPort);<br />
}<br />
My code is,
<br />
m_MulticastRcv] = Func.AddFilterByName(this.m_GraphBuilder, FilterCategory.LegacyAmFilterCategory, cNetworkInputFilterName);<br />
if (m_MulticastRcv == null) throw new Exception();<br />
IMulticastConfig Inetwork = (IMulticastConfig)m_MulticastRcv;<br />
<br />
m_hResult = Inetwork.SetMulticastGroup(InetAddress("234.1.1.1"), (ushort)System.Net.IPAddress.HostToNetworkOrder((ushort)1234));<br />
DsError.ThrowExceptionForHR(m_hResult);<br />
<br />
m_hResult = Inetwork.SetNetworkInterface(InetAddress("192.168.2.112"));<br />
DsError.ThrowExceptionForHR(m_hResult);<br />
Thanks & Regards,
Aniket A. Salunkhe
|
|
|
|
|
Hey! Guyz i'm newbie in this developing business.
so got sum issues....
please help me to find out the solution.
I'm developing an application that is Counting PagesIndexed, BackLinks and PageRank from various SearchEngines.
My Application is windows based and i'm able to fetch data from search engine. Now! I've to create a<b> Pause Button</b> that is also working as <b>Continue Button</b> and a <b>Stop button </b>to end the process of counting the PagesIndexed,PagesRank, and BackLinks..
Please! Help.......
|
|
|
|
|
if you put your main processing into a separated thread. it will be easier to pause/resume the thread.
Best regards,
Jaime.
|
|
|
|
|
There are 5 functions are getting called for different purposes for a same argument.
when Pause button is clicked, how is it possible to know which function is executed or which one is being executed currently or which one will be executing next. And then pauses the execution till the time it is resumed by again clicking the PAUSE button....
|
|
|
|
|
Assuming your processing is all in the same class, set a class-level flag indicating the pause occurred. Also assuming your processing is being done in a loop, you might try the following:
private: bool pause;
void PauseButton_Click(Object sender, EventArgs e){
pause = true;
}
void ContinueButton_Click(Object sender, EventArgs e){
pause = false;
}
void ProcessFunction(){
while(someCondition){
if(pause){
continue;
}
}
}
or
void ProcessFunction(){
while(someCondition){
while(pause){
Thread.Sleep(0);
Application.DoEvent();
}
}
}
I know some developers are against using Application.DoEvents() unless absolutely necessary, so you may perfer the first method. If you're trying to use the same button for pause and continue, then you just need the one event handler and just toggle your flag:
pause = !pause;
Brandon
|
|
|
|
|
I have created stored procedure for calculating salary.how will i access that procedure using c#.NET
vinoth
|
|
|
|
|
|
Look at that, it can give you an idea )
conn = new
SqlConnection("Server=(local);DataBase=Northwind;Integrated Security=SSPI");
conn.Open();
// 1. create a command object identifying
// the stored procedure
SqlCommand cmd = new SqlCommand(
"CustOrderHist", conn);
// 2. set the command object so it knows
// to execute a stored procedure
cmd.CommandType = CommandType.StoredProcedure;
// 3. add parameter to command, which
// will be passed to the stored procedure
cmd.Parameters.Add(
new SqlParameter("@CustomerID", custId));
thanks for everything i have...
|
|
|
|
|
if you are using SQL
then you need
1. import the system.data.sqlclient namespace
2. then create a object of sqlconnection with appropriate parameters
3. then either create a objects of sqlcommand and sqldatareader and in commad specify the storedprocedure name or you can also create a object of sqldataadaptar and sqldataset and in sqldataadaptar you can set your stored procedure name.
if u r working on anyother db than import the namespace and create objects accordingly
|
|
|
|
|
|
if you r using SQL please check the below code
string strSqlConnectionstring = "sqlserver details with provider";
System.Data.SqlClient.SqlConnection _ObjSQLCon = new System.Data.SqlClient.SqlConnection(strSqlConnectionstring.ToString());
System.Data.SqlClient.SqlCommand _ObjSqlCom = new System.Data.SqlClient.SqlCommand();
try
{
_ObjSQLCon.Open();
_ObjSqlCom.Connection = _ObjSQLCon;
// your store procedure name
_ObjSqlCom.CommandText = "Your Store procedure name";
_ObjSqlCom.CommandType = System.Data.CommandType.StoredProcedure;
// you can add parameter as per your requirement
// parameter name & datatype should be as per you have mentioned in your procedure
// set the direction of your parameter
// you need to add output parameter in the same way but direction out be output
_ObjSqlCom.Parameters.Add("your parameter name", System.Data.SqlDbType.Char, 50).Direction = System.Data.ParameterDirection.Input;
_ObjSqlCom.Parameters.Add("your output parameter name", System.Data.SqlDbType.Char, 50).Direction = System.Data.ParameterDirection.Output;
_ObjSqlCom.Parameters[0].Value = "your parameter value";
_ObjSqlCom.ExecuteNonQuery();
// to get the output value you can use either array location of that parameter or the parameter name
// if you are confused then just right click on _ObjSqlCom and view it in immediate window after you have executed _ObjSqlCom.ExecuteNonQuery();
}
catch
{
}
finally
{
strSqlConnectionstring = string.Empty;
if (_ObjSqlCom != null)
{
_ObjSqlCom.Dispose();
_ObjSqlCom = null;
}
if (_ObjSQLCon != null)
{
if (_ObjSQLCon.State != System.Data.ConnectionState.Closed)
{ _ObjSQLCon.Close(); }
_ObjSQLCon.Dispose();
_ObjSQLCon = null;
}
}
if you further douts feel free to email me at ashwin@omtechsolutions.com
Ashwin Shetty. Mumbai. India
|
|
|
|