|
Try looking at the SqlBulkCopy class in the System.Data.SqlClient namespace. I've never used it, but should give you the ability to BCP a file into a Sql table. Or if you google SqlBulkCopy .Net it should return you some sites to check out.
Jake
|
|
|
|
|
can anyone help me regarding how to retrieve data from sharepoint SQL Db through any of the sharepoint service.
I am having admin right in my machine but it's not the server where sharepoint has been installed. so can i write a c# application to access sharepoint services.
anvar sadath
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
We pick a message from queue to process. The application goes down just as we have completed picking it up from queue. Message will be lost!!!! How can we prevent that.
It's Very Very Very urgent
-- modified at 1:27 Monday 3rd April, 2006
|
|
|
|
|
Which method are u using to pick the message from the queue?
Pramod
|
|
|
|
|
|
can u please send me the actual code for that method?
Pramod
|
|
|
|
|
I've created a C# application with an Access DB on the back end. The problem I'm having is it seems like the code is executing faster than the DB can accept changes. I've got an "Add New" form that the user enters data in to add a new dealer. When the user hits the Save button, I insert the new row and close the "Add New Dealer" form. I then reload my Dealer combo box on the main form from the Dealer table. However, the code seems to be reloading the the combo before the new row makes it into the table. My first thought is to Save the row, then pause the code execution for a second or two to allow the table to catch up. Then continue the code execution and reload my combo. If there's a better solution to the problem (other than getting rid of the Access DB), I'm all ears. But at the very least, I'm looking for help on how to pause the execution of the code in for a specifict interval ("Pause(2)" function below) between the "Insert row" function and the "Reload combo" function. The pseudocode is below. Thanks in advance for any help.
//On main form
private void AddNew()
{
frmAddNew.ShowDialog();//show AddNew dialog
Pause(2);//Pause code for 2 seconds
ReloadCombo();//reload Dealer combo including newly added dealer
}
//On AddNew dialog box
private void Save()
{
CollectData();//Collect user entered data from Dialog
InsertRow();//insert new row into Dealer table
this.close;//close add new form and return control to main form
}
Jake
|
|
|
|
|
Are you using separate connections for update and reading? Are you keeping the connection open during the execution of the program?
If you keep a connection open for reading and do the update using another connection, there can be quite some time before the change is visible. If you use the same connection or close the connections when they are not used, the change should show up immediately.
---
b { font-weight: normal; }
|
|
|
|
|
That was the problem. I was using two separate connections and not closing them when I was done. I added the close statement and everything is working great now. I thought the Access DB was just so slow it couldn't keep up with the code execution. I've never used an Access DB before, I'm used to SQL Server so I wasn't sure how capable it was. I will slap my wrist for this one, I should know to do better object cleanup. Thanks for the help.
Jake
|
|
|
|
|
Is your database updated when Save method executes?
If you could send the code which actually deals with data, we could help you much easier...
|
|
|
|
|
Make sure you are refreshing the local dataset and not just sending updates to the database. Clear and refill the dataset before ReloadCombo() if you arent already, and you have made sure the local dataset is up to date. I seriously doubt your program is going faster than your database. The program should not continue execution from InsertRow() until the data has been completely updated in the database.
Aaron
|
|
|
|
|
Thanks for the info. I thought it would be odd that the code would execute faster than the DB also, but when I would step through in debug everything work fine. It was just when I executed without breaking that the problem occurred. I am refreshing the local dataset each time. In the ReloadCombo() function the first thing I do is clear the table in the dataset then do a select from the table again. I took the advice from the ealier post and closed my connection after the insert row step and that seemed to fix the issue.
Thanks,
Jake
|
|
|
|
|
Hi folks,
I am trying to use C# to get the IIS application pool identity.
I know it's possible to use Vbscript but it seems like there are no equivalent functions, properties in C#.
Do you guys know how?
Thanks,
Johny
|
|
|
|
|
|
Could you show me how to display 'a group per a page'
I have some groups and I want to display group1 on page1, group2 on page2.... Could it be possible?
Thanks so much.
|
|
|
|
|
You have different sections for each group. If you dont have more data than can fit on a page, then it is possible. Otherwise the group may go to another page. You can make the next group display on a new page by selecting the "new page after" property in the section properties.
Aaron
|
|
|
|
|
Hi guys, I need to create a listbox control. The control needs to have a button with it, up and down, which will control the navigation of the items on the control. One more thing, I need to permanently hide the vertical scrollbar.
|
|
|
|
|
What are you trying to do? The scrollbar on the listbox acts like a navigation up and down. Why do you need to hide it and do something different?
You would have to inherit the class to do what you want to do.
Aaron
|
|
|
|
|
Hi aaron...
I actually need to create a user control with that feature... a class that will inherit a listbox and within the listbox i need to add 2 button controls which will serve as a navigational tool for the items...
i have already found out how to hide the scroll bar through ShowScrollBar api call...
what i need right now is how to be able to control the items through the buttons and to be able to place the buttons at the same place (top and bottom of list box) regardless of how many items are placed in the listbox.
thanks!
|
|
|
|
|
I have a user control that inherited from Panel. I want to remove the dotted boder that the panel paints. The base.OnPaint is not called so how exaclty do I remove the Panel border?
Thanks
|
|
|
|
|
The panels I use doesn't draw a dotted border. Are you sure that it's not just the designer that draws the border?
---
b { font-weight: normal; }
|
|
|
|
|
Does it show border while in the IDE or when running the application? If it is while in the IDE then dont worry about that the IDE draws that. If you are running the application then I would like to know the Panel you are inheriting from is it part of the Windows.Forms library or you own? As far as I know Panels do not ever have a dotted border unless you put it there.
Mitchell Geere
|
|
|
|
|
The border only shows up in design-time. I created a control that inhertied from the panel though I do not want the dotted border in design time.
|
|
|
|
|
Nm my dumbness just need to add a desingner and override onpaintadorments
|
|
|
|