|
I'm using TableAdapter.Update() to insert data to database. Is there a way to update ID columne value of the inserted row in the DataSet, hopefully without select @@identity/scope_identity() method?
|
|
|
|
|
Hello,
Last time I asked how can I create an sql server alias programatically,
and Mika gave me a great link which works great.
This is what I am doing:
ManagementScope scope = new ManagementScope(@"\\" + client + @"\root\Microsoft\SqlServer\ComputerManagement");
ManagementClass clientAlias = new ManagementClass(scope, new ManagementPath("SqlServerAlias"), null);
clientAlias.Get();
ManagementObject alias = clientAlias.CreateInstance();
alias.SetPropertyValue("AliasName", aliasName);
alias.SetPropertyValue("ServerName", server);
alias.SetPropertyValue("ProtocolName", prot);
alias.SetPropertyValue("ConnectionString", conn);
alias.Put();
If the client is my local computer - works greate.
If it is a remote connection, I keep getting access denided.
What priviliges do I need ?
I tried using ConnectionOptions with user that has administrator priviligies on the client - didn't work.
Thanks
Calanit
|
|
|
|
|
Does your SQL Server permit remote connections? Is the user defined in the connection string permitted access. If you are using a trusted connection, is it a domain user?
|
|
|
|
|
Colin Angus Mackay wrote: Is the user defined in the connection string permitted access. If you are using a trusted connection, is it a domain user?
Is the bear in the woods, with a paper in one paw and some Andrex in the other?
|
|
|
|
|
Thanks - checked all the permisions, was missing domain user connection string permision.
|
|
|
|
|
calanit wrote: If it is a remote connection, I keep getting access denided
I think you need admin privileges on the target computer (not sure though). Did you have look at this: http://msdn.microsoft.com/en-us/library/system.management.managementscope.aspx[^].
One thing that could be the problem is that if you use a different username/password than your current session, do you spoecify also the domain (either the real domain if youre using domain admin or the computername itself if your useing the computer local admin).
From the link:
<code>ConnectionOptions options = new ConnectionOptions();</code>
|
|
|
|
|
Hi Mika,
Yes, I needed administrator priviliges - it is a must.
Thanks
Calanit
|
|
|
|
|
You're welcome
Mika
|
|
|
|
|
I have been wracking my brain for hours on this problem.
I have a DataGridView object that has a DataGridViewComboBoxColumn inside of it. The combo box displays fine and is populated from an Access database. The column has the Primary key mapped to the ValueMember variable and the column 'Type' is mapped to DisplayMember.
What I need is for each of these combo boxes to have their selected index (I think it is the Value property under DataGridViewComboBoxCell, but I'm pulling at straws at this point) be populated from another table. This took me about 6 seconds in Access. My problem is I cannot even find a way to access the Value/SelectedIndex of the Combobox once I place it in the DataGridView.
If anyone could help me out I'd greatly appreciate it.
Here is the code:
OleDbConnection dbCon = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"" + "NGDemoSetup.mdb" + "\"");
DataSet ds = new DataSet();
DataSet cboDs = new DataSet();
DataGridViewComboBoxColumn cboCol = new DataGridViewComboBoxColumn();
dbCon.Open();
OleDbDataAdapter da = new OleDbDataAdapter("SELECT AddrType,isRange,Value1,Value2 FROM LOCATIONINFO", dbCon);
OleDbDataAdapter cboDa = new OleDbDataAdapter("SELECT * FROM ADDRESSTYPES", dbCon);
da.Fill(ds, "LocationInfo");
cboDa.Fill(cboDs, "AddressTypes");
cboCol.Width = 100;
cboCol.DataSource = cboDs.Tables[0];
cboCol.ValueMember = "ID";
cboCol.DisplayMember = "Type";
DataTable dt = ds.Tables["LocationInfo"];
grdAddressInfo.DataSource = dt;
grdAddressInfo.Columns.Insert(0, cboCol);
grdAddressInfo.Columns[0].HeaderText = "Address Type";
grdAddressInfo.Columns[1].HeaderText = "Ranged Value";
grdAddressInfo.Columns[2].HeaderText = "From";
grdAddressInfo.Columns[3].HeaderText = "To";
dbCon.Close();
|
|
|
|
|
You can create objects of the items and then add the list of objects to the combo box.This way you can access the selected object from the datagridview cell.
|
|
|
|
|
pls help guys
im a intermediate level in c#....anyone guide me from begining to end to create a migration project in
"<big>text parsing or automatic segmentation of text</big>"
from c and c++ to c#...
i'll answer ur doubts regarding this...kindly help me.... its my college project..... time duration is 25 days<b></b>
|
|
|
|
|
|
Can you give us more detail on what you are looking at?
|
|
|
|
|
More details? He's looking for someone to do his homework.
only two letters away from being an asset
|
|
|
|
|
dear friend not like tat i just need ur help and support.. since it is my first project
|
|
|
|
|
actually set of adresses in any form will be given as input,
the program has to convert it into the standardise format.. and correct spelling mistakes and delete unnecessary spaces and hashes
then can u also tell me wat we should use instead of pointers in c#
|
|
|
|
|
lawrenceinba wrote: then can u also tell me wat we should use instead of pointers in c#
C# uses references. An instance of a class is passed as a refernce, an instance of a struct is passed by value. It is handled implicitly by the run time, you don't have to explicitly use them like you do in C++.
lawrenceinba wrote: the program has to convert it into the standardise format
Step 1 is to define what you mean by "the standardised format"
|
|
|
|
|
standard format like this
1.house no
2. streeet name
3.city
4 district
5. country
and so on
also it should remove spelling mistakes.....
n number of address will be passed and using hmm training we should train and make the output efficient
|
|
|
|
|
lawrenceinba wrote: standard format like this
1.house no
2. streeet name
3.city
4 district
5. country
That doesn't tell anyone enough. How are the parts of the address separated from one another? Is it in XML, field length delimited, comma separated, etc.
lawrenceinba wrote: it should remove spelling mistakes.....
From an address? How is it going to know that? Do you have a dictionary of approved spellings?
lawrenceinba wrote: using hmm training we should train and make the output efficient
What is "hmm training"? Is that some sort of generic algorithm?
Define what you mean by "efficient" output.
|
|
|
|
|
Do your own homework.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
lawrenceinba wrote: guide me from begining to end
It is your homework - How about you trying to do it then if you get stuck come back and ask for specific help.
lawrenceinba wrote: a migration project in
"text parsing or automatic segmentation of text"
That is a bit on the vague side. A project title tells people very little about what it actually needs to accomplish. How about if I tell you the project title of what I'll be doing in January: "Opera Integration upgrade to version 5" - Now, what does that actually tell you?
|
|
|
|
|
Colin Angus Mackay wrote: How about if I tell you the project title of what I'll be doing in January: "Opera Integration upgrade to version 5" - Now, what does that actually tell you?
It tells me that you're working on a sideline project providing scaffolding for the dresses of the "waif-like" opera singers.
|
|
|
|
|
Pete O'Hanlon wrote: It tells me that you're working on a sideline project providing scaffolding for the dresses of the "waif-like" opera singers.
Nice try! But, ultimately, incorrect.
|
|
|
|
|
ya i'll be doing i just need help from u guys
|
|
|
|
|
Well, when you have something specific that we can help with then please let us know.
|
|
|
|