Click here to Skip to main content
15,925,528 members
Home / Discussions / C#
   

C#

 
GeneralFile Streaming Pin
RockRock12-Oct-04 6:42
RockRock12-Oct-04 6:42 
GeneralRe: File Streaming Pin
Heath Stewart12-Oct-04 7:29
protectorHeath Stewart12-Oct-04 7:29 
GeneralRe: File Streaming Pin
yoaz13-Oct-04 7:19
yoaz13-Oct-04 7:19 
GeneralResizing Individual Tabs on a TabControl Pin
dbromberg12-Oct-04 6:06
dbromberg12-Oct-04 6:06 
GeneralRe: Resizing Individual Tabs on a TabControl Pin
Heath Stewart12-Oct-04 11:12
protectorHeath Stewart12-Oct-04 11:12 
GeneralUpdate Command - Please Help Pin
amdacc12-Oct-04 3:16
amdacc12-Oct-04 3:16 
GeneralRe: Update Command - Please Help Pin
Colin Angus Mackay12-Oct-04 3:43
Colin Angus Mackay12-Oct-04 3:43 
GeneralRe: Update Command - Please Help Pin
amdacc12-Oct-04 9:22
amdacc12-Oct-04 9:22 
hi, Thanks for getting back to me. Dont wory about the password, its only set up like that for beginners like me to play. Its not used for anything important.

I have been looking at code from all over the internet, and since i started this, non of the examples i have used have helped. Thats why its mis-matched. i have now managed to blag some help here and i have this

SqlCommand cmd;
string sType = "";
string sBkInMake="";
string sBkInModel= "";
string sBkInSN= "";
string sIPAddress ="";
string sStore = "";
string sUssage = "";

string myConnectString = "Data Source=devserver2;Persist Security Info=False;Initial Catalog=storeInventory;User ID=sa;password=;";
SqlConnection myConnection = new SqlConnection(myConnectString);

if (txtBkInSN.Text.Length != 0)
{
myConnection.Open();

sType= txtBkInType.Text;
sBkInMake= txtBkInMake.Text;
sBkInModel= txtBkInModel.Text;
sBkInSN= txtBkInSN.Text;
sIPAddress =txtBkOutIP.Text;
sStore = cboBkOutStoreNo.Text;
sUssage = txtBkOutUssage.Text;

MyData.Tables[0].Rows[0]["IpAddress"] = sIPAddress;
MyData.Tables[0].Rows[0]["Store"] = sStore;
MyData.Tables[0].Rows[0]["Ussage"] = sUssage;

cmd = new SqlCommand("UPDATE Items " +
"set IPAddress = " + sIPAddress + " ,Store = " + sStore + " ,Ussage = " + "'" + sUssage + "' where SerialNo = '" + txtBkInSN.Text.Trim() + "'", myConnection);

da.UpdateCommand = cmd;
da.Fill(MyData,"Items");
da.Update(MyData,"Items");

myConnection.Close();
MessageBox.Show("Saved");
Clear();
}
else
MessageBox.Show("Please Find a Serial Number and complete relevant infromation before pressing save.");

I dont know if it is the best way to do it, but........ it seems to be working ok.

Thanks Again

Angela
GeneralRe: Update Command - Please Help Pin
Colin Angus Mackay12-Oct-04 11:02
Colin Angus Mackay12-Oct-04 11:02 
GeneralRe: Update Command - Please Help Pin
Heath Stewart12-Oct-04 7:36
protectorHeath Stewart12-Oct-04 7:36 
GeneralRe: Update Command - Please Help Pin
amdacc12-Oct-04 9:27
amdacc12-Oct-04 9:27 
GeneralRe: Update Command - Please Help Pin
Colin Angus Mackay12-Oct-04 10:47
Colin Angus Mackay12-Oct-04 10:47 
GeneralRe: Update Command - Please Help Pin
2Scoops13-Oct-04 22:57
2Scoops13-Oct-04 22:57 
GeneralRe: Update Command - Please Help Pin
Heath Stewart12-Oct-04 10:56
protectorHeath Stewart12-Oct-04 10:56 
GeneralCrystal Reports Formulas Pin
NormDroid12-Oct-04 1:38
professionalNormDroid12-Oct-04 1:38 
GeneralRe: Crystal Reports Formulas Pin
Heath Stewart12-Oct-04 7:19
protectorHeath Stewart12-Oct-04 7:19 
GeneralRe: Crystal Reports Formulas Pin
NormDroid12-Oct-04 20:36
professionalNormDroid12-Oct-04 20:36 
GeneralSelect Statement Pin
pat27088112-Oct-04 1:26
pat27088112-Oct-04 1:26 
GeneralRe: Select Statement Pin
Stanciu Vlad12-Oct-04 2:24
Stanciu Vlad12-Oct-04 2:24 
GeneralRe: Select Statement Pin
Heath Stewart12-Oct-04 7:13
protectorHeath Stewart12-Oct-04 7:13 
GeneralRe: Select Statement Pin
Mike Dimmick12-Oct-04 2:47
Mike Dimmick12-Oct-04 2:47 
GeneralRe: Select Statement Pin
pat27088112-Oct-04 3:14
pat27088112-Oct-04 3:14 
GeneralRe: Select Statement Pin
Colin Angus Mackay12-Oct-04 3:21
Colin Angus Mackay12-Oct-04 3:21 
GeneralRe: Select Statement Pin
pat27088112-Oct-04 3:45
pat27088112-Oct-04 3:45 
GeneralRe: Select Statement Pin
Heath Stewart12-Oct-04 7:17
protectorHeath Stewart12-Oct-04 7:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.