Im switching to the
System.IO.Packaging
Seems a bit more reliable...
Im switching to the
System.IO.Packaging
Seems a bit more reliable...
Hey there, i am trying to zip .bak files while making the backup , this application schedules backups and then backs up databases on the server , so now i want to zip or compres these files , can anyone give me some advise on how to do this ??
private void openfiledialog_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
textBox1.Text = openFileDialog1.FileName;
openFileDialog1.Dispose();
}
private void LetsZIPIT(object sender, EventArgs e)
{
try
{
FileStream m_FileStream = File.Open(textBox1.Text, FileMode.OpenOrCreate);
GZipStream ZipStream = new GZipStream(m_FileStream, CompressionMode.Compress, true);
//ZipStream.Write(byte[], 0, 1);
MessageBox.Show("SUCCESSSSSSSS.........");
}
catch (Exception E)
{
MessageBox.Show(E.Message);
}
}
private void btnzip_Click(object sender, EventArgs e)
{
LetsZIPPPIT(sender, e);
}
This just takes all the data out of the file .... i feel stupid for no knowing this ...
Any example will be amazing , even if its just to zip a text file , i will play with the code,
Regards,
mr Von Zipper
SELECT FILEGROUP_NAME(1) AS [Filegroup_Name];
This works cool and all , but i want all the stuff to display in one listbox ....
hey there lovely people, i am trying to make an application that makes database backups, now obviously i need to add the file / filegroup backup option too , which is not a problem except for this one little problem...
How can i get the application to display a list of all the primaries and and FG's ?
I realized that this would have to be done because not all administrators use the same naming structure ...
If anyone could at least just give me an idea of where to go, thank you in advance ...
ok the error was found in the accountNumber columns, thanks anyway
Hey there, i really want to break my pc by now
can anyone tell me how to get around this ??
I just want to update the new database here
USE NGCOLLECT
GO
INSERT INTO dbo.Cases
(
CustId
, Consultant
, Bank
, OldAccountNo
, LastAmountReceived
, DateReceived
, ArrearAmount
, VehicleMake
, RegistrationNo
, ChassisNo
, FirstName
, Surname
, IDNumber
, HomeTel
, WorkTel
, CellNo
, Address_1
, Address_2
, Province
, Code
, OtherFirstName
, OtherSurname
, OtherIDNumber
, OtherHomeTel
, OtherWorkTel
)
SELECT
4
, Collector
, 'Wesbank'
, oldAccountNumber
, Last_Pay_Amount
, Last_Pay_Date
, Balance
, Car_Description
, Registration_Number
, Chassis_Number
, Name_
, Surname
, IDNumber
, Tel_H
, Tel_W
, Tel_Cell
, Client_Address
, Client_Address1
, Zone
, Address_Code
, Surety2_Name
, Surety2_Surname
, Surety2_ID_Number
, Surety2_H_tel
, Surety2_B_tel
FROM [TL].dbo.[Detailed_List]
I get this error :
Msg 2601, Level 14, State 1, Line 2
Cannot insert duplicate key row in object 'dbo.Cases' with unique index 'IX_Cases'.
The statement has been terminated.
Any help PLEASE !!!
Hey hey
I have two tables with a lot of data, i need to insert certain column values from table one into table two - eg
Table one column = First_Name
Table two column = Name
I need to get all the values in table one (First_Name) into table two (Name), these records should be appended..
Any help would really be appreciated ?
Hi , I have 2 columns named
1. Tel_H
2. Tel_H_Code
How can i merge these two columns to make them one ??
I am clueless here...The best i can do is to view them as one
SELECT Tel_H_Code + Tel_H AS 'Tel_H'
FROM Detailed_List
Oh cool this seems to work
SELECT name
FROM master.dbo.sysdatabases
WHERE name NOT IN ('master','model','msdb','tempdb')
Hey can anyone give me the query to retrieve a list of databases on a server rather than this query
SELECT NAME FROM sysobjects
which gives me a list of tables ????
Thank you
Sup ladies and gentlemen, please help me, i need to loop through the listbox, now here's what i have
foreach (ListViewItem ListItem in listView_Replacement.Items)
{
// finding the string in the current item rows
string m_findText = listView_Replacement.Items[0].Text;
string m_replaceText = listView_Replacement.Items[0].SubItems[1].Text;
string m_Messagetext = txtMessage.Text;
string m_MessageTextNew = txtMessage.Text.Replace("" + m_findText + "", "" + m_replaceText + "");
txtMessage.Text = m_MessageTextNew;
txtMessage.Refresh();
}
Now obviously those values should not be [0] and [1] because i am looping , but can anyone give me any idea what to put in there ???
Thank you in advance
CvZ
That looks like a mass-mailing application...not sure I WANT to help, but does it just not work or are you getting an exception?
If you're getting an exception, what is it?
If it just "doesn't work", what debugging (to ensure you are getting the right parameters set) have you done?
thanks dude, it works, and you are right, mass mailing , not for spamming though...
Nevermind it does work , it sent to my junk folder , i never saw it , thank you guys ....
Hey people , i am trying to send an email, but for some reason its just not sending ... please help me out , here's my code
// trying this block of code
try
{
// Looping through the rows in the datatable
foreach (DataRow Row in dt.Rows)
{
//declaring strings to hold the values
string camp_code = Row["Campaign_Code"].ToString();
string camp_name = Row["Campaign_Name"].ToString();
string comapny_name = Row["company"].ToString();
string email_address = Row["email"].ToString();
//settind txtTo.text to the value in the email string variable
txtTo.Text = email_address;
// Declaring a new instance of a mail message
MailMessage E_Mail_Message = new MailMessage();
//MailAddress MA = new MailAddress("info@place.co.za");
// Adding the To address to the mail message
// The to address is = txtTo.Text
E_Mail_Message.To.Add(new MailAddress(txtTo.Text));
// Setting the body of the email message
// The body is = txtMessage.Text
E_Mail_Message.Body = txtMessage.Text;
// Setting the subject of the email message
// The subject is = txtSubject.Text
E_Mail_Message.Subject = txtSubject.Text;
// Setting the from address of the email message
// The from address is = txtFrom.Text
E_Mail_Message.From = new MailAddress(txtFrom.Text);
// Declaring an instance of a SMTP client
SmtpClient SMTP = new SmtpClient("smtp.place.com", 25);
if (CB_Authentication.Checked == true)
{
// Setting SMTP Default credentials to false
SMTP.UseDefaultCredentials = false;
// Adding new Credentials
System.Net.NetworkCredential theCredential = new System.Net.NetworkCredential(txtUsername.Text, txtPassword.Text);
// setting smtp credentials to the new credentials
SMTP.Credentials = theCredential;
}
if (cboPorts.Text == "SMTP")
{
SMTP.Port = 25;
}
if (cboPorts.Text == "POP")
{
SMTP.Port = 110;
}
if (cboPorts.Text == "FTP")
{ …
So I am completely new to ASP .NET and my first page needs to be a log in page.
I have a database in SQL 2000 that has a table called tblEmployee. This table holds usernames, passwords, and group security details. I need to grab quite a few fields from tblEmployee and store them somewhere until the users session has expired. I need to hold their EmployeeID, GroupID, ProviderNumber...etc.
Would I store all of these results in the web.config file?
Hey dude i think the answer is YES, you can use the web config file but you will have to override the default database and create a master detail relationship
Please let me know when you get to override the web.config file connection string
Can anyone please provide me with some help to over ride the web.config file in VS 2005 , i am new to the ASP scene, and it is all rather confusing!
i want to create a login page with three user roles
1 - Admin
2 - Manager
3 - User
How will i be able to create my own database and use it with the standard ASP.Net login control and web administration tool ???
Any help would be appreciated
Hey people ....
I am trying to dynamically load data into combo boxes on selection of the first combo box items...
I am Using MySql and PHP .... i really just don't know what to do anymore ... please please please help me ...
PS - i am actually a C# Developer so web development is new to me
Here's my code, if you want it
<html>
<?php
//Creating a connection *******************************************************************************************
$connection = mysql_connect("localhost", "root", "*********");
if (!$connection)
{
die("Database connection failed : " .mysql_error() );
}
// ****************************************************************************************************************
//Selecting the four databases ************************************************************************************
$db_Sections = mysql_select_db("ncs_quote_system", $connection);
if (!$db_Sections)
{
die("Database selection failed : " .mysql_error() );
}
//*****************************************************************************************************************
?>
<head>
<script language="javascript">
function Select_Section()
{
var choice = document.formname.Sections.options[document.formname.Sections.selectedIndex].value;
if(choice == ['Description'])
{
document.all['Sub_Categories'].style.display = "none";
document.all['Categories'].style.display = "";
}
else if(choice == ['Description'])
{
document.all['Sub_Categories'].style.display = "";
document.all['Categories'].style.display = "none";
}
else
{
document.all['Sub_Categories'].style.display = "none";
document.all['Categories'].style.display = "none";
}
}
</script>
</head>
<body>
<form name="formname">
<?php
echo '<select name="Sections" onchange="Select_Section()">';
//Selecting table Sections *****************************************************************
$Sections = mysql_query("SELECT Description FROM sections", $connection);
if (!$Sections)
{
die("Database query failed : " .mysql_error() );
}
while ($RowSections = mysql_fetch_array($Sections))
{
echo '<option value='.$RowSections['Description'].'>'.$RowSections['Description'].'</option>';
}
echo '</select>';
?>
<br><br>
<div style="position: absolute; display: none" name="Categories_div" id="Categories_div">
<?php
echo '<select name="Categories">';
//Selecting table Sub_Categories ******************************************************************
$Sub_Categories = mysql_query("SELECT Description FROM subcategories, category_subcategory_link WHERE subcategories.id = category_subcategory_link.CategoryId ", $connection);
if (!$Sub_Categories)
{
die("Database query failed : " .mysql_error() );
}
while ($RowSubCategories = mysql_fetch_array($Sub_Categories))
{
echo '<option …
Hi guys,
I am trying to hide 2 list boxes, then on selection changed show a new list box with JavaScript, i am very very new to web development in general, I am actually a software developer in the Pascal and C# language so this is all very new to me, please help with any ideas or code ?
This is what i have
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%">
<tr>
<td align="center" valign="middle" style="background: url('Image2.jpg') no-repeat fixed 50% top; height: 113px; color: #FFFFFF; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: bold; line-height: normal;" valign="top" class="style1">
NCS Quote System</td>
</tr>
<tr >
<td style="width: 100%" valign="top" align="center" >
<select title="Select a section :">
<?php
//Selecting table Sections *****************************************************************
$Sections = mysql_query("SELECT * FROM sections", $connection);
if (!$Sections)
{
die("Database query failed : " .mysql_error() );
}
while ($RowSections = mysql_fetch_array($Sections))
{
echo '<option value='.$RowSections['Description'].'>'.$RowSections['Description'].'</option>';
}
echo '</select>';
?>
</td>
</tr>
<tr>
<td style="width: 100%" valign="top" align="center">
<?php
echo '<select>';
//Selecting table Categories *********************************************************
$Categories = mysql_query("SELECT * FROM categories, section_category_link WHERE categories.id = section_category_link.CategoryId", $connection);
if (!$Categories)
{
die("Database query failed : " .mysql_error() );
}
while ($RowCategories = mysql_fetch_array($Categories))
{
echo '<option value='.$RowCategories['Description'].'>'.$RowCategories['Description'].'</option>';
}
echo '</select>';
?>
</td>
</tr>
<tr>
<td style="width: 20%" valign="top" align="center">
<?php
echo '<select>';
//Selecting table Sub_Categories ******************************************************************
$Sub_Categories = mysql_query("SELECT * FROM subcategories, category_subcategory_link WHERE subcategories.id = category_subcategory_link.CategoryId ", $connection);
if (!$Sub_Categories)
{
die("Database query failed : " .mysql_error() );
}
while ($RowSubCategories = mysql_fetch_array($Sub_Categories))
{
echo …
Hey guys , thanks for the help on that
Yeah its a big mission, but unfortunately its possible....
your normal program.cs looks like :
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace GetMousePosition
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
now this is what you do :
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace GetMousePosition
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1(Form2));
}
}
}
its something along those lines
have fun
private void button1_Click(object sender, EventArgs e)
{
Panel1.hide();
panel2.hide();
panel3.hide();
//BUT
Panel 4.show();
}
Yeah sorry man, use delphi... it works .... but not in visual studio but i did that with panels
you can use panels to act as tabs
The oviously on button_click event you just hide all of them and show the one you want to show
EG :
private void button1_Click(object sender, EventArgs e)
Panel1.hide();
panel2.hide();
panel3.hide();
//BUT
Panel 4.show();
just note, you will have to coomplete a layer of work (or do them panel by panel) because panels can be child to other panels , so once you move a panel it gets stuck in another panel
have fun
Hey dude, hahaha, welcome to the confusion club, heres what you'll do ...
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
int X = MousePosition.X;
int Y = MousePosition.Y;
TxtShowX.Text = X.ToString();
txtShowY.Text = Y.ToString();
if (MousePosition.IsEmpty == true)
{
TxtShowX.Text = "Mouve The Mouse";
txtShowY.Text = "Mouve The Mouse";
}
Dude i just tried it and it works funky chicken
Maybe you can help me with datagridview ???
Have a nice day man
Hi Daniweb people
I have a really stupid question, strangely it has been keeping me busy for several days now and i just cant help but to ask for help...
ive searched the whole of the MSDN libraries but no code seems to work for this
I am making an application that displays a list of movies
I am using a prebuilt SQL Server 2005 database Connected to a DatagridView
Columns =
1 - ID
2 - Movie_Title
3 - Main_Actor
4 - Release_Year
5 - Genre
6 - Rating
now i can add new rows, no problem, but for some reason (Being a delphi programmer rather than C#) i can not locate the Cursor status to update and Delete selected rows
Any help would be appreciated...
Or maybe tell me what i am missing??
#region GetRow()
public PaulsDataBaseDataSet3.tblMoviesRow GetRow()
{
DataRowView drv;
try
{
drv = (DataRowView)tblMoviesBindingSource.Current;
return (PaulsDataBaseDataSet3.tblMoviesRow)drv.Row;
}
catch (Exception EX)
{
MessageBox.Show(EX.Message);
}
}
#endregion
#region Update Display
private void UpdateDisplay()
{
EditFormMovies EditMovies = new EditFormMovies();
if (tblMoviesBindingSource.Position == -1)
return;
if (UseThisDataSet.tblMovies.Rows[tblMoviesBindingSource.Position].RowState == DataRowState.Deleted)
return;
//display original values
DataRow dr;
dr = UseThisDataSet.tblMovies.Rows[tblMoviesBindingSource.Position];
EditMovies.txtID.Text = dr["ID"].ToString();
EditMovies.txtMovieTitle.Text = dr["Movie_Title"].ToString();
EditMovies.txtActor.Text = dr["Actors"].ToString();
EditMovies.txtGenre.Text = dr["Genre"].ToString();
EditMovies.txtRating.Text = dr["Rating"].ToString();
EditMovies.txtYear.Text = dr["Release_Year"].ToString();
if (dr.HasVersion(DataRowVersion.Original))
{
EditMovies.txtID.Text = dr["ID", DataRowVersion.Original].ToString();
EditMovies.txtMovieTitle.Text = dr["Movie_Title", DataRowVersion.Original].ToString();
EditMovies.txtActor.Text = dr["Actors", DataRowVersion.Original].ToString();
EditMovies.txtGenre.Text = dr["Genre", DataRowVersion.Original].ToString();
EditMovies.txtRating.Text = dr["Rating", DataRowVersion.Original].ToString();
EditMovies.txtYear.Text = dr["Release_Year", DataRowVersion.Original].ToString();
} …
Hey guys i have an application where i assign values to the type of sale it would be -- here's my code --
procedure TPaymentForm.OkButtonClick(Sender: TObject);
begin
//ID 1 - Cash Sale
IF (CashRadioButton.Checked) Then
BEGIN //Opening Data Source and Stuff, Setting The Columns and Stuff
Data.Statement_Entries_Table.Append;
Data.Statement_Entries_Table.FieldByName('customer_id').AsInteger;
Data.Statement_Entries_Table.FieldByName('date_time').AsDateTime := Now;
Data.Statement_Entries_Table.FieldByName('description').AsString;
Data.Statement_Entries_Table.FieldByName('amnount').AsCurrency := TxtAmount.Value;
Data.Statement_Entries_Table.FieldByName('entrytype').AsInteger := 1;
Data.Statement_Entries_Table.FieldByName('entry_ref').AsInteger;
Data.Statement_Entries_Table.Post;
END;
//ID 2 - Cedit Sale
IF (CreditRadioButton.Checked) Then
BEGIN //Opening Data Source and Stuff, Setting The Columns and Stuff
Data.Statement_Entries_Table.Append;
Data.Statement_Entries_Table.FieldByName('customer_id').AsInteger;
Data.Statement_Entries_Table.FieldByName('date_time').AsDateTime := Now;
Data.Statement_Entries_Table.FieldByName('description').AsString;
Data.Statement_Entries_Table.FieldByName('amnount').AsCurrency := TxtAmount.Value;
Data.Statement_Entries_Table.FieldByName('entrytype').AsInteger := 2;
Data.Statement_Entries_Table.FieldByName('entry_ref').AsInteger;
Data.Statement_Entries_Table.Post;
END;
//ID 3 - Internetsale
IF (InetrnetTransferRadioButton.Checked) Then
BEGIN //Opening Data Source and Stuff, Setting The Columns and Stuff
Data.Statement_Entries_Table.Append;
Data.Statement_Entries_Table.FieldByName('customer_id').AsInteger;
Data.Statement_Entries_Table.FieldByName('date_time').AsDateTime := Now;
Data.Statement_Entries_Table.FieldByName('description').AsString;
Data.Statement_Entries_Table.FieldByName('amnount').AsCurrency := TxtAmount.Value;
Data.Statement_Entries_Table.FieldByName('entrytype').AsInteger := 3;
Data.Statement_Entries_Table.FieldByName('entry_ref').AsInteger;
Data.Statement_Entries_Table.Post;
END;
//ID 4 - Cheque sale
IF (ChequeRadioButton.Checked) Then
BEGIN //Opening Data Source and Stuff, Setting The Columns and Stuff
Data.Statement_Entries_Table.Append;
Data.Statement_Entries_Table.FieldByName('customer_id').AsInteger;
Data.Statement_Entries_Table.FieldByName('date_time').AsDateTime := Now;
Data.Statement_Entries_Table.FieldByName('description').AsString;
Data.Statement_Entries_Table.FieldByName('amnount').AsCurrency := TxtAmount.Value;
Data.Statement_Entries_Table.FieldByName('entrytype').AsInteger := 4;
Data.Statement_Entries_Table.FieldByName('entry_ref').AsInteger;
Data.Statement_Entries_Table.Post;
END;
CashRadioButton.Checked := False;
CreditRadioButton.Checked := False;
InetrnetTransferRadioButton.Checked := False;
ChequeRadioButton.Checked := False;
TxtAmount.Text := '';
Close;
end;
I have a text box for entering an amount into the data, and 4 radio butttons or option buttons whatever for choosing an option of payment...
Every time i click on the ok button the entry is stored in the first row of the Datatable and overrides the original one....
i am using MS Office access as database...
Please help...
Thanks for your reply, but my problem is in designing table like view for entering products, rates, amount like in grid view.
Why dont you try to tell me exactly where you're going, then i can have a clear view of what you need ??? sounds Good ??
Hi guys,
Stupid Question....
How can i group specific rows in a cxGrid (Express Quantum Grid 6)...
this event will occur onClick...
any ideas ???
Delphi 7....
Aaah, i figured it out guys...using repositories to create styles and change colour, then set the qty to that style, adios...to all those who might wana know
I have an idea... i should work...If you are using Delphi - go to 'Project' - 'Options' - then a menu will appear that shows you your forms, put ALL your forms before your Data module page, they will then run before the data module and your problem is solved, also try this - set all connections to false, then code on your form show event
DBMODULENAME.TABLENAME.Open;
and on form close
DBMODULENAME.TABLENAME.close;
You will have to get either SQL or some Data base manager...
make column's for an 'id' (Primary key + auto number) , 'Description' (Text), 'Price' (Currency), 'VAT' (Number) and 'TOTAL' (Currency)...then connect labels, textboxes or anything really to that database, you should find the properties in the sidebar if you are using a builder (Visual Studio??) .. Optionally you can add Date column etc...
OR
you can use classes ??? Need more help, let me know...
Good day
I'd like to find out how to change the color of a row on a page startup in Delphi 7 pro with an Express Quantum grid 6
What i am trying to achieve is this
if Quantity in stock = >10 row color should be green...
if Quantity in stock = <10 and >5 row color should be Yellow...
if Quantity in stock = >5 row color should be Red..
Any help would be appreciated
Hey dudes...i am currently working for a company that codes in delphi 7... i am familliar with C# language but not that much of Pascal language...i need to make a form where i can print an added HTML page...
I managed to get it to print a form but i wnat to enable the print dialog thing so that people can select their own printers and page size...
heres what i have...
private
{ Private declarations }
public
{ Public declarations }
end;
var
PrintPreviewForm: TPrintPreviewForm;
implementation
{$R *.dfm}
//******************************************************************************
//******************* Printer options ***************************************
procedure TPrintPreviewForm.PrinterOptionsButtonClick(Sender: TObject);
begin
Htmlviewer1 :=GetDialog; // *** PROBLEM !!!!!!!!!!!!! ******
end;
//******************** Cancel Print Button *************************************
procedure TPrintPreviewForm.CancelPrintButtonClick(Sender: TObject);
begin
Close;
end;
//******************* Print Button *********************************************
procedure TPrintPreviewForm.PrintButtonClick(Sender: TObject);
begin
Htmlviewer1.Print(0,999);
end;
//****************** Ending of code ***************************************
end.
Please please please give me a snippet...
thank you very much...
Get visual studio 2008 express edition at www.visualstudio.com for free (you will be charged by the connection client though) and do the tutorials on the application and you'll be coding in no time
You can try the (Try - Catch) ... would then just display an error
Chances are that you have an endless loop there my friend
Ok, well basically i've done everything up to the point where i just need to know how to hide an integer value in a read only textbox???
Hi there , yes I am studying MCSD - its accredited by Microsoft...:icon_razz:
Good Evening (Morning to others)
I would like to find how it would be possible to create a calculator with only one entry field, i have managed to make one with two entry fields resulting in a ([2LeftOperand] + [2RightOperand]) calculation...i have tried hiding the Right Text box, and even to set the opacity to 0.0000 but these result an minor complications, yes i am studying but and it is part of an assignment, but i would greatly appreciate any suggestions and if possible - maybe code snippets too...
Regards...:-/