|
i wanna ask about the ability to connect sql server 2000 database files
without installing sqlserver 2000 itself but i'm hearin about MS desktop engine can give me this ability with coding using my application is this true or not?
|
|
|
|
|
Do not cross post. I already answered you in the SQL forum[^]
|
|
|
|
|
Hi,
I have a form with multiple textboxes that are bound to a dataset.
When a user changes the content of the textbox how do I get those changes passed back to the database with a "save" button click?
Glen Harvy
|
|
|
|
|
In .NET 2.0 you get use generated table adapter code and call Update on it and pass the dataset as arg. But sounds like you could use a bit of reading on the dataset and ado.
Wout
|
|
|
|
|
Only got 1.1 .
How do you do it in 1.1?
Glen Harvy
-- modified at 7:53 Sunday 23rd July, 2006
|
|
|
|
|
here is an example of doin this in .net 1.1
we got two col in this form textBoxBankID and TextBoxBankName. I hope this should solve ur problem
DataRow dr = accounts1.Bank.NewRow();
textBoxBankID.Text = ((decimal)accounts1.Bank.Rows[accounts1.Bank.Rows.Count-1]["BankID"]+1).ToString();
sqlInsertCommand1.Parameters["@BankID"].Value = bID = Convert.ToDecimal(textBoxBankID.Text);
sqlInsertCommand1.Parameters["@BankName"].Value = textBoxBankName.Text;
dr["BankID"] = bID;
dr["BankName"] = textBoxBankName.Text;
accounts1.Bank.Rows.Add(dr);
int n = sqlDataAdapter1.Update(accounts1,"Bank");
MessageBox.Show(n.ToString());
accounts1.AcceptChanges();
// write code to refresh the dataset
//as ds.Clear();
//da.Fill(ds,"Bank");
Rocky
|
|
|
|
|
Are u suggesting that I create a new dataset with the data that I want to be displayed to the user by filling it with the data from the various related tables?
As far as reading material is concerned - what do u suggest? I have searched the net extensively and have purchased "A programmers guide to ADO.Net in C#" but I'm stll confused!!
Glen Harvy
|
|
|
|
|
Hi,
I need some example how to do it - i really don't understand how to do use invoke method in control.
Thanks.
|
|
|
|
|
Take a look through these [^]articles on CP. Don't follow my sig guidelines
As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it
|
|
|
|
|
very simple methods are in C#,
view some programms and see how it works.
http://www.engineeringproject.net
|
|
|
|
|
The example is easy:
private void button1_Click(object sender, EventArgs e)
{
MethodInvoker mi = new MethodInvoker(MyMethod);
Invoke(mi);
}
private void MyMethod()
{
}
|
|
|
|
|
Hi,
How can I develop a win service to detect IP changes,
actually I have a win service listening on a port to do some print jobs, I have to send the ip address at first for a web service, so I want to update the IP address for the service,
How can I write the thread in the service???
MMR
|
|
|
|
|
yeah, try NotifyAddrChange function in Ip Helper
The NotifyAddrChange function causes a notification to be sent to the caller whenever a change occurs in the table that maps IPv4 addresses to interfaces.
DWORD NotifyAddrChange(
PHANDLE Handle,
LPOVERLAPPED overlapped
);
Parameters
Handle
[out] A pointer to a HANDLE variable that receives a file handle for use in a subsequent call to the GetOverlappedResult function.
Warning Do not close this handle, and do not associate it with a completion port.
overlapped
[in] A pointer to an OVERLAPPED structure that notifies the caller of any changes in the table that maps IP addresses to interfaces.
Return Values
If the function succeeds, the return value is NO_ERROR if the caller specifies NULL for the Handle and overlapped parameters. If the caller specifies non-NULL parameters, the return value for success is ERROR_IO_PENDING.
If the function fails, use FormatMessage to obtain the message string for the returned error.
Return code Description
ERROR_CANCELLED The context is being deregistered, so the call was cancelled immediately.
ERROR_INVALID_PARAMETER An invalid parameter was passed. This error is returned if the client already has made a change notification request, so this duplicate request will fail.
ERROR_NOT_ENOUGH_MEMORY There was insufficient memory available to complete the operation.
Using P/Invoke to import this function to a static Method
[DllImport("Iphlpapi.dll")]
public static UInt32 NotifyAddrChange(
ref IntPtr Handle,
ref OVERLAPPED overlapped
);
//
struct OVERLAPPED
{
....................
}
|
|
|
|
|
How to excecute stored procedure by using c# application in run time?
I need to know the coding.
Please someone help me as soon as possible
Thanx
Thilani
|
|
|
|
|
00thilani wrote: How to excecute stored procedure by using c# application in run time?
Have you searched anywhere yet?
The following classes will be useful to you:
* SqlConnection[^]
* SqlCommand[^]
* SqlDataReader[^]
The following properties and methods on the command will be useful to you:
* CommandType[^]
* ExecuteReader()[^]
If you try something and it doesn't work then show us what you've tried and we can help you out. There are plenty examples in the links that I gave you. If you are still stuck, show us what you did and we can correct it for you.
|
|
|
|
|
I have a WebBrowser component on a form, and it interacts with a site (www.zoomin.co.nz)though Javascript.
The Javascript contains functions such as GPoint gpt= GMap.getCenterLatLong()
In my application I need to be able to call that function in Javascript and find out the values for gpt (of the two floating point values that make it up) in my C# code.
Thanks
|
|
|
|
|
If you look inside the Document property there is a method called Invoke or InvokeScript (something like that anyway), you can pass the function name and parameters of the JavaScript function to invoke through this. As for getting the results it's probably documented in the documentation about the InvokeScript function.
(This may not be completely accurate but I do know that such a method does exists since I've used it but for reasons given in my sig I won't guarantee the accuracy )
As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it
|
|
|
|
|
Thanks - I will look at invoke script
I was not too lazy to google it, but found nothing straightforward fron the search
|
|
|
|
|
hi
i am using c# and ms access and i have a search functionality in my app... i am wondering what's the concept behind showing the search progress by a progress bar?
thanks for your help in advance
|
|
|
|
|
If you have the number of items being searched then just use a progress bar with Maximum set to that value and set Value to the current index you're searching.
If you don't know how many items you're searching then you're best of using the ProgressBar (in .NET 2) with Style set to Marquee which is an "infinite" progressbar. If you're using .NET 1.x there are some articles here on CP which are to do with "Busy" bars which are essentially the same thing.
As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it
|
|
|
|
|
Thanks but what index you're talking about?
I'm using the LIKE clause to do a simple search...
|
|
|
|
|
Please be more specific with your questions in the future or you'll get more answers you won't understand...
I assume you're executing an SqlCommand (or something similar) that's taking some time and you don't want your UI to hang while this command is running, right?
If this is the case, you could create a progressbar (infinite, like Ed.Poore suggested, since you don't know how long the command will run) and then execute the SqlCommand in a WorkerThread .
That way your UI will remain responsive while the SqlCommand is being executed. Once the command has finished you'll have to signalize to your initial class that the progress bar can be removed and that the results can be displayed.
If you're still unclear on how to do this, please google for the words written in code style to get more information on them (esp. WorkerThread ).
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
The index is referring to (for example) if you were searching through a list or an array then you'll have to iterate through the items and you can use the position of the array / list (i.e. the index) you're currently at to display in the progress bar.
You were not clear in your original question as to what you were searching so I gave you two possible methods. If you're executing an SQL Query then you'll have to use an infinite progress bar.
As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it
|
|
|
|
|
Hi,
I have a form that has a number of textBoxes that are bound to a one row table in a database. What I want the user to be able to do is change the value in the textbox and then click a save button to save all/any of the changes to the database.
I don't wish to "hard code" the methods and have devised the following; Note that the textboxes are named with the datatables columns prefixed by "textBox" eg Column1 becomes textBoxColumn1.
private void button1_SaveChangesClick(object sender, System.EventArgs e)
{
// Changes made to the text boxes need to be passed to the dataset dsMyClub1
// Create the DataTable
DataTable dtMyClub = dsMyClub1.Tables["MyClub"];
// Create variables containing the original values in the table
DataRow dtMyClubDataRow = dtMyClub.Rows.Find(1);
foreach (DataColumn myDataColumn in dtMyClub.Columns)
{
// reads the datatable and place the value in the variable
string columnName = myDataColumn.ToString();
string columnValue = dtMyClubDataRow[myDataColumn].ToString();
// get the value of the corresponding textbox into a variable
string tempTextBoxName = ("textBox" + columnName);
string textBoxName = tempTextBoxName;
string textBoxNameValue = this.textBoxName.Text.ToString();
// compare the variable with the textbox to see if it has changed
// if it has then update the datatable
if(columnValue != textBoxNameValue)
{
MessageBox.Show("Values are not equal" + columnValue + " " + textBoxNameValue);
}
else
{
MessageBox.Show("Values are equal");
}
The messageBoxes are just for debugging.
The programme has build errors in that "this.textBoxName" doesn't exist at build time.
The problem I have is getting the value in the corresponding textBox so that I can compare values. The only thing I'm getting into textBoxNameValue is the name of the textBox.
TIA
Glen Harvy
-- modified at 22:26 Saturday 22nd July, 2006
|
|
|
|
|
1. Use the Control.Name property (assign the variable name to it) and search for the control with the wanted name inside the Form.Controls collection to find the wanted TextBox.
2. Use reflection to retrieve the value of TextBox with given variable name.
"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
|
|
|
|